RewriteEngine help
hi... could anyone help me with rewrite module plz... im not good in it..
i need this:
currently, i have this code in .htaccess, but it does not work with advice section (i only tested the index.php-related cases since the site is under constuction):
if there are howlers, please don't laugh, but help... thanks
i need this:
if (not a real file or real folder) {
for "/advice/" go to "/advice.php?page=advice"
for "/advice/[smth]/" go to "advice.php?page=advice&advice=[smth]"
for "/news/" go to "/news.php?page=news"
for "/news/[smth]/" go to "news.php?page=news&news=[smth]"
for "/places/" go to "/places.php?page=places"
for "/places/[smth]/" go to "places.php?page=places&placetype=[smth]"
for "/places/[smth]/[smth2]/" go to "places.php?page=places&placetype=[smth]&place=[smth2]"
for "/[smth]/" go to "/index.php?page=[smth]"
for "/[smth]/[smth2]/" go to "/index.php?page=[smth]&subpage=[smth2]"
}
currently, i have this code in .htaccess, but it does not work with advice section (i only tested the index.php-related cases since the site is under constuction):
RewriteEngine on
#RewriteRule ^advice/?$ advice.php?page=advice&test=testing [L]
RewriteRule ^advice/?$ advice.php?page=advice [L]
RewriteRule ^news/?$ news.php [L]
RewriteRule ^advice/([^/\.]+)/?$ advice.php?page=advice&advice=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&subpage=$2 [L]
if there are howlers, please don't laugh, but help... thanks
0
This discussion has been closed.
Comments