WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Redirect loop problem after primary domain change. (6 posts)

  1. linscami
    Member
    Posted 8 months ago #

    Hello!

    I manage a WordPress Multi-site portal and recently, for contractual reasons, we had to change the URL from portaltagit.com to portaltagit.ne10.uol.com.br. I followed these instructions and everything seemed to be working just fine: http://wpengine.com/support/how-to-change-a-multi-site-primary-domain/

    We needed to redirect people who accessed the site through portaltagit.com to portaltagit.ne10.uol.com.br – no problem there. But when someone with an old link, like http://portaltagit.com/moda/17802 tried to access, they would be redirected automatically to the site homepage, not the post itself. I found an apparent solution, by adding this line to my htaccess file after the WordPress stuff:

    RedirectMatch 301 /(.*) http://portaltagit.ne10.uol.com.br/$1

    And again, the URL changed like I wanted it to, but I then I came across a new problem: This webpage has a redirect loop. And now I'm stuck. I don't have any other redirects anywhere that I can possibly think of, and I really need the old links to work.

    Here is my complete htaccess file, without the RedirectMatch line, since it was throwing an error:

    # BEGIN WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress
  2. Those aren;t the right directions.

    You wanted http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite

  3. linscami
    Member
    Posted 8 months ago #

    I checked the tables and used this http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ as instructed, but nothing has changed. I still have the same redirect problems.

  4. Where is http://portaltagit.com/ located? I mean, where's the .htaccess for this?

    You SHOULD be able to just park that old domain on top of the new one to transparently redirect.

  5. linscami
    Member
    Posted 8 months ago #

    The htaccess is in the /public_html folder for the portaltagit.com domain. The portaltagit.ne10.uol.com.br is an "empty" domain, that is set to mirror everything in the root directory of portaltagit.com via apache, so there's really no redirect set to happen from the server.

    Things I've noticed:
    - The upload folder inside WordPress doesn't redirect: http://portaltagit.com/wp-content/uploads/sites/6/2013/11/queenie.jpg and works with either URL: http://portaltagit.ne10.uol.com.br/wp-content/uploads/sites/6/2013/11/queenie.jpg

    - When I access some folder that doesn't exist, the redirect happens, instead of showing me the 404. Via portaltagit.ne10.uol.com.br I get the 404 page, as it should: http://portaltagit.ne10.uol.com.br/exemple. But via portaltagit.com I just get redirected again: http://portaltagit.com/exemple.

    - When I access a folder that does exist, and is outside of WordPress, it doesn't redirect and works as it should: http://portaltagit.com/termos and http://portaltagit.ne10.uol.com.br/termos.

    That's why I'm thinking there's some redirect coming from WordPress that I don't know about, and that is causing the loop when I try to set one on my htaccess file.

  6. linscami
    Member
    Posted 8 months ago #

    We decided to just move everything to the new server and leave the old one empty, so as to not create any form of weird redirect that we had no idea where was coming from. It took a while, but we figured it was the best way to do it.

    Thank you very much for your help!

Reply

You must log in to post.

About this Topic