: 301 directory redirect exclude subdirectory I need to do a 301 directory redirect in my httpd.conf file but exclude a subdirectory within the directory. Example: RedirectPermanent /redirect/ http://www.mysite.com/.
I need to do a 301 directory redirect in my httpd.conf file but exclude a subdirectory within the directory.
Example: RedirectPermanent /redirect/ www.mysite.com/.
But I want to exclude this subdirectory /redirect/example/.
Any ideas?
I tried this and it didn't work:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/redirect/example/?$ [NC]
RewriteRule ^/redirect/? mysite.com [R=301,L]
More posts by @Yeniel560
1 Comments
Sorted by latest first Latest Oldest Best
You should be able to do a RedirectPermanent for the parent directory then setup a sym link to the example directory in your web root dir.
Now test that this much actually works. If it does, create an Alias (http.conf) for the old directory to now point to the new directory link.
Assuming that RedirectPermanent is just looking for URLs which begin with specific text this should work. Unfortunately, I haven't tested any of this but presume that it'd work.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.