The MU forums have moved to WordPress.org

Redirects - Some Work Some Don't (13 posts)

  1. lwatkins
    Member
    Posted 16 years ago #

    I hesitate to ask this but I have now spent ten hours on this and I promise I have read, and re-read every post on here on redirects and have tried and retried everything I have read. I must be missing something, but I can't figure out what it is.

    I am changing the format of my site from multiple installations of Wordpress to one MU installation.

    I some subdirectories which are not wordpress and I can easily get the redirection to work on them. The problem seems to be because the new blogs are virtual subfolders.

    The problem arises when I try to set-up a direct for a previous subdomain of the same name to the new mu blog of the same name (set-up for folder access).

    If I add the following to my htaccess file I get 500 server errors:

    RewriteCond %{HTTP_HOST} art.aneducationaljourney.com
    RewriteCond %{REQUEST_URI} !art/
    RewriteRule ^(.*)$ art/$1 [L]

    Currently the domain http://art.aneducationaljourney.com redirects to just http://aneducationaljourney.com and does not send it to the art blog where it should go.

    I have tried redirecting individual posts using a simple 301 redirect one by one and they also result in server errors or a direct to the main domain.

    At this point I am about to simply give up, but really don't want to lose everything I have indexed. However, Google won't recognize that the URL needs removed because it is redirecting somewhere. But most importantly the visitors will not land on the page they are expecting.

    I'm hoping that someone can point me in a direction that I haven't tired even though I have tried all the fixes I could find recommended here. And sorry to again post something that has been addressed "500 times" but I am at a loss.

  2. andrea_r
    Moderator
    Posted 16 years ago #

    So.... just to clarify, the original blogs were in subdomains, and now they're in subfolders in MU?

  3. lwatkins
    Member
    Posted 16 years ago #

    Yes. That is correct.

  4. wpmuguru
    Member
    Posted 16 years ago #

    Try

    RewriteCond %{HTTP_HOST} art.aneducationaljourney.com
    RewriteRule %{REQUEST_URI} !art/
    RewriteRule ^(.*)$ http://aneducationaljourney.com/art/$1 [R=301,L]
  5. lwatkins
    Member
    Posted 16 years ago #

    Thanks for the help!

    When I switch it out to this:

    RewriteCond %{HTTP_HOST} art.aneducationaljourney.com
    RewriteRule %{REQUEST_URI} !art/
    RewriteRule ^(.*)$ http://aneducationaljourney.com/art/$1 [R=301,L]

    to the .htaccess file I get redirect errors and a URL that says:

    http://aneducationaljourney.com/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/art/science/...

  6. wpmuguru
    Member
    Posted 16 years ago #

    Oops, the second line should be a RewriteCond not a RewriteRule and you may need to change !art/ to !^art/

  7. lwatkins
    Member
    Posted 16 years ago #

    Thanks once again wpmuguru!

    This is what I have now, but it still just redirects to the home page of the site and not to the art blog.

    I did try the !art/ method and that lead to 500 Server Errors.

    RewriteCond %{HTTP_HOST} art.aneducationaljourney.com
    RewriteCond %{REQUEST_URI} ^art/
    RewriteRule ^(.*)$ http://aneducationaljourney.com/art/$1 [R=301,L]

    I've got quite a few posts that are number one on Google and it would be such a bummer to have all of that traffic go to the homepage as that will greatly reduce the stickiness and the user experience.

  8. lwatkins
    Member
    Posted 16 years ago #

    I wanted to update you that I may have figured out the problem.

    I've done plenty of redirects on this server over the years and never had a problem. They've always worked.

    But this morning I decided to double check the server configuration in case something changed on it recently. Well the PHP Info file shows that the Mod Rewrite Engine isn't installed. I've contacted my host and hopefully that will solve the problem.

    I'll let you know either way.

  9. lwatkins
    Member
    Posted 16 years ago #

    OK. I've heard back from support on the server configuration and they confirmed that the Mod Rewrite Engine is working, so that isn't it.

    Now checking to see if it is some old virtual server configurations. Beyond that I'm out of ideas.

  10. wpmuguru
    Member
    Posted 16 years ago #

    One more try :D

    RewriteCond %{HTTP_HOST} art.aneducationaljourney.com
    RewriteCond %{REQUEST_URI} ^art/(.*)$
    RewriteRule . http://aneducationaljourney.com/art/%1 [R=301,L]
  11. lwatkins
    Member
    Posted 16 years ago #

    Thanks again. I've been working with my webhost the last 24 hours to make sure there isn't any residuals left from earlier subdomains that could be causing problems.

    During that process I realized that I had them install a wildcard configuration because I read that was the way it needed to be for subdomains on Wordpress. Then in the process I changed to directories and forgot to have them remove it.

    First off, is that correct. The wildcard config only needs to be done for Wordpress MU installations on subdirectories?

    The next thing is that when we had that removed and removed left over references to the old subdomains it resulted now in a new error. A simple 404 error rather than referring to the home page of the site.

    But the problem is that is still does not redirect.

    I did try the htaccess configurations above.

    Am I missing anything else?

  12. andrea_r
    Moderator
    Posted 16 years ago #

    The wildcard configuration is only needed if you have a subdomain setup.

  13. lwatkins
    Member
    Posted 16 years ago #

    I finally got this to work. Here's how:

    I had the host go in and delete any references to the old sites on the server so there was no confusion there.

    I then set-up a new subdomain using my cpanel to match the old subdomain name, but this time I told it to use a different folder name.

    So the subdomain art was living in the artblog folder. Then I used the cPanel redirection feature to redirect to the Wordpress MU site.

    Basically, I could not redirect the subdomain if the subdomain no longer existed, and it could not have the same folder name as the existing Wordpress MU site.

    Thanks everyone for your assistance.

About this Topic

  • Started 16 years ago by lwatkins
  • Latest reply from lwatkins