Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1409964
    Alan
    Participant

    I thought I had the changes made, but need some help.

    I moved a development site from the development host to what will be the production host. Now the homepage comes up, but every other page returns a 301 error that says the page has been moved to a location that is actually the URL of the page!

    Domain name for right now is ArtsyAlly.net. I have it set as such in WordPress Address and Site Address. X Theme is activated. Full URL links to IDs on the homepage work from on the homepage, but go to 301 error by direct browser entry (http://www.artsyally.net/home#location-about). All http://www.artsyally.net/AnyPage addresses go to a 301 error when entered into the browser. I can login to WP admin fine.

    What have I left undone?

    #1409980
    Alan
    Participant
    This reply has been marked as private.
    #1410158
    Alan
    Participant

    I ran Better Search Replace that found >2,300 instances or the old domain name in posts and postmeta tables. I ran it again to replace them all with artsyally.net, and still get the Permanently Moved 301 error.

    #1410161
    Alan
    Participant

    Even added a new page thinking that the issue might be with existing pages, but also get 301 with it. Looks like WP is just not letting any traffic into its world.

    I got rid of my .htaccess in the WP root, cleared browser cache, and still got the 301 even with no .htaccess in the way. Then reinstated .htaccess.

    I deactivated every plug-in and still 301 errors.

    #1410496
    Alan
    Participant

    Mystery Solved and some training for everyone!

    The bizarre (to me) solution was to rearrange the two parts of my .htaccess. Here it is for anyone who similarly bangs their heads against their desks…

    I need for my .htaccess to do two things; get people browsing Domain1.com to the WP instance in the web root of the site, and redirect users browsing Domain2.com to the WP instance in a subdirectory called SubdirectoryName herein. The code sections follow. The .htaccess file causing 301 errors for every page except Home had the redirect method BEFORE the WP method. I moved the WP method above the redirect method out of desperation and the site behaved normally, with Domain2.com redirecting as desired. No claim of knowing WHY it worked; only THAT it worked…

    Moral of the story is that WP looks like a prima donna who demands to be recognized first.

    Standard WP construct:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Redirect code to send Domain2.com to the WP instance in SubdirectoryName

    # BEGIN redirect to SubdirectoryName
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$
    RewriteCond %{REQUEST_URI} !^/SubDirectoryName/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /SubDirectoryName/\
    RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$
    RewriteRule ^(/)?$ SubDirectoryName/index.php
    RewriteBase /
    RewriteRule ^index.(.*)?$ http://domain2.com/SubDirectoryName/ [r=301]
    # END redirect to SubdirectoryName

    Danged if I can completely interpret either of those chunks. We don’t have to learn every piece of code any longer and the WP ecosystem is alive and well. Glad to pay for X, support, and a few worthy plugins to reduce the incline of the learning curve. I just don’t have time – or desire – to fool with it these days. I designed my first site in Notepad, with a few buttons and a header built in Photoshop, in about 1997 to put my senior research paper online (http://alancole.com/oldeoriginal) – just to see if I could. Then you HAD to know every dot and slash, but there were fewer of them, and it was more of a conquest thing. You could, as the book was entitled, “Learn HTML in 24 Hours”.

    I hope this helps some frustrated soul get a few extra hours of sleep.

    #1410569
    Lely
    Moderator

    Thank you for sharing and glad you have figured this out!

    Cheers.

  • <script> jQuery(function($){ $("#no-reply-1409964 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>