I'm currently using mod_rewrite to rewrite URLs with server variables.
Expand|Select|Wrap|Line Numbers
- RewriteEngine on
- RewriteRule ^([A-Za-z0-9-_]+)$ /layout4/$1/ [R]
- RewriteRule ^([A-Za-z0-9-_]+)/?$ index.php?dir=&page=$1
- RewriteRule ^([A-Za-z0-9-_/]+)/([A-Za-z0-9-_]+)$ /layout4/$1/$2/ [R]
- RewriteRule ^([A-Za-z0-9-_/]+)/([A-Za-z0-9-_]+)/?$ index.php?dir=$1&page=$2
What I'd like to do is somehow enable visitors to actually open a folder. ie. I have a folder http://localhost/layout4/discography, but when I type that in, mod_rewrite thinks that its a query of a sort and doesn't lead to the folder discography or rather, discography/index.php. What should I do? Or is the better way to simply not use index.php and redirect http://localhost/layout4/discography to something like http://localhost/layout4/discography/main.php?
Thanks y'all! :D