Jump to content
php.lv forumi

mod_rewrite


million

Recommended Posts

Labdien!

 

Tikla ir vairaki mod_rewrite rule generatori, ievadot dinamisku (php) adresi rada statisku (html) un kodu.

Parrakstiju, bet nestrada! Ir ta, ka www.abc.lv/view.php?lang=lv&id=72 japarvers www.abc.lv/view/lv/72.htm

Atverot www.abc.lv/view.php?lang=lv&id=72 ta ari rada, bet ievadot www.abc.lv/view/lv/72.htm rada to pasu, ka vajag (html).

Ka izdarit , lai atverot www.abc.lv/view.php?lang=lv&id=72 radija www.abc.lv/view/lv/72.htm ?

 

Options +FollowSymLinks

RewriteEngine on

RewriteRule view/(.*)/(.*)\.htm$ /view.php?lang=$1&id=$2[R=301,L]

Link to comment
Share on other sites

pēc $2 ieliec atstarpi un izņem ārā R=301,

 

Paldies.

Izdariju, bet neka :(

 

Kataloga ir atseviskas preces. Vini atveras jaunaja loga. Nospiezot labu pogu -> properties rada neparveidotu adresi.

Lidz ar to neindeksejas lapas saturs :(

 

Ir vel kads padoms?

Link to comment
Share on other sites

Ir cits jautajums, varbut, palidzesiet.

 

Jaunaja loga nav jabut address bar, standart buttos toolbar.

Es parveidoju a href un tapec varbut javascript vairs nedarbojas?

 

<tr><td height='220' align='center'><a href=\"$lang-$res->id.htm\" target='_blank', 'Name1','directories=no, left=50, top=50, width=1070, height=800, location=no,menubar=no,resizable=yes,scrollbars=yes, status=no,toolbar=no');//\">

Link to comment
Share on other sites

echo "<a href=\"$lang-$res->id.htm\" target=\"_blank\" onclick=\"window.open(this.href,'Name1','directories=no, left=50, top=50, width=1070, height=800, location=no,menubar=no,resizable=yes,scrollbars=yes, status=no,toolbar=no'); return false;\">";

Link to comment
Share on other sites

  • 2 weeks later...
echo "<a href=\"$lang-$res->id.htm\" target=\"_blank\" onclick=\"window.open(this.href,'Name1','directories=no, left=50, top=50, width=1070, height=800, location=no,menubar=no,resizable=yes,scrollbars=yes, status=no,toolbar=no'); return false;\">";

 

Labdien!

 

Paldies! Esmu izlabojis, bet kad ar peli gribu uzspiest virsu bildei, peles kursors nemainas uz "pirkstinu" (nekadas reakcijas uz linku).

Kapec ta? Un ka uztaisit ar "pirkstinu"?

Link to comment
Share on other sites

Ir vel viens jautajums:

.htaccess faila pieveinoju vel vienu rewrite rule. Tas darbojas bet nekorekti, jo ielade visu kaut kada sakroplota forma (bez bilem, bez teksta stiliem un ta talak...). Kad ierakstu R=301 nobeiguma, tad ielade lapu ka vajag, bet ari nekorekti: pirms tam ka nospiest, browser loga apaksa rada parveidotu linku, bet kad nospied, tad adrese ir neparveidota (browser address ailina).

Ko ietiksiet, lai darbotos korrekti?

 

Options +FollowSymLinks

RewriteEngine on

RewriteRule ^(.*)-(.*)\.htm$ /view.php?lang=$1&id=$2

RewriteRule ^action/(.*)/section/(.*)/page/(.*)/lang/(.*)/$ /?action=$1&section=$2&page=$3〈=$4 [R=301,L]

Link to comment
Share on other sites

×
×
  • Create New...