Forum Moderators: phranque
I've done a google search, and couldn't find the exact answer to my question on here.
Basically, I want to redirect htdocs/public/old/* to /htdocs/public/new/redirect.php
That I can do myself easily enough, using a PermanentRedirect.
However, I need to keep one sub directory under old at the same URL.
So my question is, how do I exclude a single directory from a redirect.
If I browse to htdocs/public/old/aaa/index.php or htdocs/public/old/index.php etc, I get redirected.
However, if I browse to htdocs/public/old/STAYHERE/index.php - I do not.
I'm assuming that there is some regex I could use here?
Any help is much appreciated!
Best regards,
-> httpd.conf
RewriteEngine On
RewriteCond %{REQUEST_URI}!^/htdocs/public/old/STAYHERE
RewriteRule ^/htdocs/public/old/(.*) /htdocs/public/new/redirect.php [R=301,L]
-> .htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI}!^/htdocs/public/old/STAYHERE
RewriteRule ^/htdocs/public/old/(.*) /htdocs/public/new/redirect.php [R=301,L]