• 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-x

    You’ll end up at
    https://target-site.com/topic-x

    So 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?

Viewing 15 replies - 16 through 30 (of 30 total)
  • Thread Starter everwill

    (@everwill)

    I need multi-site because I have more than 100 different domains. The problem (as I stated in my OP) is that while each domain has certain very specific information to that domain, some information is general to all domains and I don’t want to duplicate the content in all of those domains. Rather I want one specific folder to in all of those domains to resolve to the main domain.

    As a side note I wish I’d known before I configured that you can’t map more than one domain to the main domain. That sort of sucks.

    Thread Starter everwill

    (@everwill)

    Rather I want one specific folder to in all of those domains to resolve to the main domain.

    I mean to say: Rather I want one specific folder to in all of those domains to resolve to a specific folder on one of these domains.

    some information is general to all domains and I don’t want to duplicate the content in all of those domains.

    I thought I addressed this earlier, but…

    duplicate content only pertains to content on the *same* domain. If it didn’t, then there wouldn’t be post scrapers. ??

    If you had subfolder blogs with the same content, Google would give you a duplicate content warning.

    If they are subdomain blog, Google will *not* give duplicate content warning.

    Same as if they are full domains.

    Thread Starter everwill

    (@everwill)

    I supposed I could just flesh out all these with the same content …

    Google was a concern, but I also wanted to make it easier for the user to see and understand the structure …

    Thread Starter everwill

    (@everwill)

    Okay, there is definitely something freaky going on here and I think it’s Plesk related. I don’t have a logical reason, but my Spider-sense is tingling. Without further editorial, here’s the strange part:

    I used the same piece of code above and I used it in a static folder with simple straight-forward files … and got the same error as above. File not found on this server.

    Thread Starter everwill

    (@everwill)

    Okay … now let me ask you if I’ve discovered something truly strange or if this is just another FMC* error. I tinkered with the code (nominally) and then accidentally named the file ,htaccess (as in comma htaccess) and it worked like a champ. I renamed .htaccess and wham file not found. Changed it back to comma and all worked.

    —————————————–
    *FMC error = An old programmer buddy would from time to time find that his code didn’t work for no apparent reason. He went through the code line by line over and over and over. Of course, the problem wasn’t the logic of the program it was nothing more than some obscure syntax problem hidden in a blur of characters. When after hours of seraching he finally found the error he would continually under his breath, “F****ing moronic child … ” Thus the origins of the FMC error.

    Thread Starter everwill

    (@everwill)

    Well, well, well …

    Sorry for the multi-post but I’m also hoping that documenting my ineptitude will help the next stranger lost in the forest.

    I thought I was all clear but I just learned that ,htaccess works fine on one domain but is forbidden on another. So I am to assume that , and . mean something different in the mysterious world of htaccess …

    The plot thickens.

    Yes, in the mysterious world of computers , and . are completely different. ??

    .htaccess is the proper file name.

    Thread Starter everwill

    (@everwill)

    Yes but why would , work and . not work? Do you know what is the difference.

    BTW, I’m back onto thinking that this is and FMC-related error. And it’s a case study in why things like this will make you go crazy.

    I have a plugin — when you tell a tale of WP villainy there’s always a plugin lurking in there somewhere — that automatically writes a redirect when it detects certain changes. It does this to help you from breaking links. I discovered this when I tried to put the pieces of my puzzle back together and now I think this is the reason I was having bizarre nonsensical errors.

    So, without walking you through some of the details of my site, I’m going to try this again, but compensate for the plugin compensation and hopefully all will finally work.

    Yeah, strip it down to as close to a naked install as possible.

    No idea why ,htaccess worked. o_O

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Realistically, there’s no system I know of that groks ,htaccess so more likely is that your setup doesn’t like .htaccess at all.

    What happens if you make a blank file called .htaccess on the one with the ,htaccess?

    Thread Starter everwill

    (@everwill)

    I actually already have a few .htaccess redirects that are working without problem in other directories already. I’ve had success in the past with simple non-conditional stuff. I have to shake through a few kinks to compensate for the compensation as it were, so I’ll come back to this when I have more info to share.

    Right, but you can exclude htaccess from working in specific directories in the server config. ??

    Thread Starter everwill

    (@everwill)

    I assume you’re talking about .htaccess and not ,htaccess? ;^)

    ?? Yes.

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘Infinite redirect / Conditional .htaccess’ is closed to new replies.