5

I have been having problems with my website and as a result did a Crawl test in SEOmoz. The test found a 301 Permanently Moved Redirect of all the pages on the website and it appears that they are redirected back to themselves?

After completing a crawl of my website I found that there is this huge amount of what appears to be corrupted data added to the URL for each of these pages: https://www.getyourphotosoncanvas.com/%7Egetyouv4/%7Egetyouv4/contact-us.html 301 redirects to https://www.getyourphotosoncanvas.com/%7Egetyouv4/contact-us.html

This is then followed by an long list of redirects each adding another line, e.g.: domain/7Egetyouv4/%7Egetyouv4/%7Egetyouv4/../%7Egetyouv4/%/contact-us.html

This repeated part, %7Egetyouv4, goes on forever... I have shortened it for the post and removed the domain name to prevent a third link (post limit).

I know this has got to be a problem. Bluehost support says that they show no 301 redirects, then that it might be a problem in the WP xmlrpc.php file? I am a novice at this can someone please tell me what all this means?

Just to clarify, I did not set the redirects, don't need redirects, this just showed up without my knowledge. Some have suggested a hack?

More importantly, can you tell me how to fix it?

4 Answers 4

3

I know that this is an ancient thread but I ran across it searching for the exact solution in March 2017. I hope this solution is the trial fix that works for someone and saves a little sanity. I posted it in the X Theme support forum since I had been asking for help there, and decided that it needed wider exposure.

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 after deactivating plugins, searching & replacing a lot of lingering development domain URLs with Better Search Replace plug-in, and even deactivating the .htaccess altogether (didn't know how close I came with that one), and the and the site behaved normally, with Domain2.com redirecting as desired.

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/$1
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 know what all of that redirect syntax means. 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 1994-5 to put my senior research paper online – 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!

1

Go through your File Transfer Program (FTP) and look for a file labeled ".htacess"

Delete everything in it and put in the following code:

# 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

Once this is done go into the permalinks settings and update to what you want them.

1
  • You may be correct but there are other ways to redirect besides .htaccess. A plugin or the theme could do it with wp_redirect or wp_safe_redirect. Why do you think this is an .htaccess issue and not some other issue?
    – s_ha_dum
    Commented Apr 23, 2013 at 3:46
1

This can be due to various problems: bad code in your theme, bad code in a plugin, .htaccess configuration issue...

If you don't know how to edit the .htaccess, you can start by doing the following:

  • Change your theme
  • Deactivate your plugins

If it doesn't solve the problem, it will probably be related to your .htaccess.

If this solves the problem, try reverting back to your original theme and check if the issue is back. If it is, it's a theme issue. If not, try reactivating the plugins one by one and test after each reactivation to identify which one causes the redirect.

One thing you can do is scan your website with http://sucuri.net/ to make sure there is no corrupted file. If everything is clean, it starts to be a more complex issue to debug.

0

Delete your htaccess file and update your permalinks option and see if it fixes the problem.

2
  • Thanks for the reply. I'm a novice at this! Sorry, How would I delete this file and there is no mention of replacing it. How would you update the permalinks option?
    – user16360
    Commented May 22, 2012 at 16:54
  • remove .htaccess from the root of your site (where wp-config is). Then go to SETTINGS > PERMALINKS page in the admin and it will automatically create a new .htaccess. Commented Feb 27, 2014 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.