Jump to content
php.lv forumi

mod rewrite vai switch?


chizijs

Recommended Posts

Problēma ir sekojoša, kad ieeju adresē http://adrese.lv/lapa parada to lapu, bet kad ieeju http://adrese.lv/lapa/ rada, ka lapa netika atrasta?

.htacces

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]
RewriteRule ^(.*)$ index.php?p=$1 [QSA,L]

index.php

if($_GET['p']) {
$fails =  "lpp/".$_GET['p'].".php";
if(file_exists($fails)) include $fails; 
else echo "lapa netika atrasta!";
}
else include "lpp/default.php";

Edited by chizijs
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...