Results 1 to 2 of 2
Apr 26, 2005, 20:59 #1
simple mod rewrite to pass through index.php
How do I force every single request to pass through index.php ?
Except .css, .js , gif, jpg, png, swf
This only works on .php files
RewriteRule ^(.*)\.php$ /site/index.php?id=$1
Many Grateful Thanks in advance...
Apr 26, 2005, 21:45 #2
- Join Date
- Feb 2002
- 18 Post(s)
- 2 Thread(s)
Your regex should cause a loop, not just redirect your support files through index.php!
Okay, I'm a believer in being as specific as you can when dealing with regex (there are exceptions) so I'd recommend taking the EVERYTHING atom out and constraining your PAGE names to lowercase with php, htm and html as possible extensions. That said, it's easy enough to just pass the root directory's filename (w/o extension) as the query string value:
RewriteEngine On RewriteRule ^([a-z]+)\.(php|htm|html)$ site/index.php?id=$1 [L]