Forum Moderators: phranque
/xml
/xsl
/process
I would like to redirect any url (ex: www.mysite.com/new) to /process/index.php from my httpd.conf. This php page will analyse the request and create the correct output through some xml transformations. Of course I don't want to redirect if the url contains "/process/", "/xml/" or "/xsl/". I tried many patterns but I don't know how to specifiy the urls that I want to exclude from my RewriteRule.
Would be nice if someone could help me...
Many thanks
1) We put the page you are building as the default page for the error 404 file. This means it only gets called if the old page isn't found anyway.
2) We return an error 301 message "page has permanently moved here" for any page request that is in our list and redirect anything else that we may have missed to the home page (although I am sure a proper 404 message would be more helpful to the user).
Not sure we are using PHP though, I think ours is .asp but hopefully it will do the job.
Welcome to WebmasterWorld [webmasterworld.com]!
You need to place a RewriteCond ahead of your RewriteRule to exclude those paths:
RewriteCond %{REQUEST_URI} !^/(process¦x[ms]l)/$
Ref: Introduction to mod_rewrite [webmasterworld.com]
Jim