Infinite redirect / Conditional .htaccess
-
My MU has multiple sites with very specific info in each site. However, there are certain over-arching zones of interest that apply across multiple blogs. I’d like to avoid duplicate content on multiple sites but I want the easiest possible user experience. So, what I’ve decided would be best is to use .htaccess to route certain specific directories to the parent site. That way, if you’re go to:
https://site.com/topic-x
https://site1.com/topic-x
https://site2.com/topic-x
https://site3.com/topic-xYou’ll end up at
https://target-site.com/topic-xSo what I found works is that I drop this into the htaccess of a given directory:
RewriteEngine on RewriteRule ^(.*)$ https://target-site.com/topic-x/$1 [R=301,L]
This works great for Topic-x.
Here’s my problem: topic-y is actually a dynamic executable that has redirect built-into the code. That means that the code at target-site.com/topic-y automatically directs to https://target-site.com/topic-y which is where my .htaccess redirects to target-site.com and so on forever.
In this case, re-writing the executable is not an option. And, because I’m using MU whatever I drop into that directory applies to every site on the host.
I think what I need is a conditional .htaccess statement but writing that conditional htaccess is beyond my present experience.
Help?
- The topic ‘Infinite redirect / Conditional .htaccess’ is closed to new replies.