That would be a potential start… but you’ll have to test your regex for the RewriteCondition (it must only rewrite the URL if showfile.php is NOT present in the URI) as well as the correct URL in the rule below ;)
It’s just the regexps that I’m having problems with. I’ve got it running, but I don’t know how to get it to run how I want it to… see my comment above…
9 Responses for "Why does mod_rewrite hate me so?"
Which version of Apache?
RewriteCond %{REQUEST_URI} !*\/showfile\.php*
RewriteRule (.*) /showfile\.php?name=$1 [R=permanent,NE]
That would be a potential start… but you’ll have to test your regex for the RewriteCondition (it must only rewrite the URL if showfile.php is NOT present in the URI) as well as the correct URL in the rule below ;)
It’s already explained in apache httpd.conf file :)
Or visit the apache website… thye have an example code.
I did that, but it didn’t help me.
Have you tried the above?
You need to specify the following in the .htaccess or the <VirtualHost> directive:
RewriteEngine On
:
:
The colons above refer to the above items I included. I used that to tell people that a piece of software had moved. It worked pretty well.
Well I’ve got other files that I don’t want to be rewritten, so what I was wanting to do was to only move the following:
http://wwf.slippers.com/files/* -> http://wwf.slippers.com/showfile.php?name=/files/*
http://wwf.slippers.com/css/* -> http://wwf.slippers.com/showfile.php?name=/css/*
http://wwf.slippers.com/misc/* -> http://wwf.slippers.com/showfile.php?name=/misc/*
How would I go about doing that?
It’s just the regexps that I’m having problems with. I’ve got it running, but I don’t know how to get it to run how I want it to… see my comment above…
Never mind, worked it out by adapting by what you suggested above. Thanks :D
Excellent :)
Enjoy!
Leave a reply