Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

RewriteEngine help

edited November 2007 in Vanilla 1.0 Help
hi... could anyone help me with rewrite module plz... im not good in it..

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

Comments

  • hm... i noticed another thing: when i turn the engine off, and type in site/advice/ then the advice.php page opens fine.. which means that the server (local) treats site/smth like site/smth.php ... i did not notive this problem with index.php-related rewrite rules, since the name of the file is index, not like any of the virtual dirs (they are all site/contact etc..). .. i'll try to look up the issue on the web... help appreciated as usual.. thanks..
  • ok... i simply remaned the physical file and it works fine...
This discussion has been closed.