mod-rewrite
Posted: Wed Jun 28, 2006 10:12 am
Here's my .htacess file as it is, the comments describe what i'm trying achieve:
I've played around with about ten variations of this and I either get internal server errors or it doesn't do what I want. I have a feeling I need to use RewriteConds but you don't seem to be able to test them against the standard request string.
Any help will be greatly appreicated.
Code: Select all
RewriteEngine on
# rewrite something like "www.bob.com/any/number/of/directories/css/file.css" to "www.bob.com/css/file.css"
RewriteRule css/(.*) /css$1
# do the same for js, gfx and file
RewriteRule js/(.*) /js$1
RewriteRule gfx/(.*) /gfx$1
RewriteRule file/(.*) /file$1
# everything else should be redirected to index.php which is in the document root
RewriteRule !(css|file|js|gfx)/ index.phpAny help will be greatly appreicated.