Tagged: x
-
AuthorPosts
-
March 16, 2017 at 1:19 pm #1409964
AlanParticipantI 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?
March 16, 2017 at 1:32 pm #1409980
AlanParticipantThis reply has been marked as private.March 16, 2017 at 4:12 pm #1410158
AlanParticipantI 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.
March 16, 2017 at 4:15 pm #1410161
AlanParticipantEven 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.
March 16, 2017 at 8:42 pm #1410496
AlanParticipantMystery 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 WordPressRedirect 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 SubdirectoryNameDanged 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.
March 16, 2017 at 9:33 pm #1410569
LelyModeratorThank you for sharing and glad you have figured this out!
Cheers.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1409964 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
