
The day may come for you, as it has for me, when you decide you want to reorganize your site’s page structure, rename pages by changing the URL name, or delete pages entirely.
Whenever you delete or rename a URL it is possible that those pages have already been indexed in search engines. If those pages show up in a search result then the person clicking on those links will be sent to pages that no longer exist. In other words, they will arrive at a 404 page not found error message. This can be a somewhat frightening prospect but fear not, there is simple solution.
This fix came from BANS member skolvikings. He has written these instructions in his own words and added them to his blog.
My instructions to redirect deleted or renamed URLs to new pages with a 301 redirect: | |
Go to the .htaccess file (click here if you don’t know how to do this) for your site and open it for editing. | |
| Save a copy of the original code (click here for instructions on how to do this). | |
| Search for the following code (your code may have more spaces between them than what you see here): | |
| Options +FollowSymLinks RewriteEngine On | |
| Copy the contents of 301-redirect.txt and paste it directly UNDER the above code. | |
| Note: Make the following changes before saving: | |
| |
| So, using the above examples, your 301 redirect would look like this: | |
| RewriteCond %{HTTP_HOST} ^YourURL.com$ [OR] RewriteCond %{HTTP_HOST} ^www.YourURL.com$ RewriteRule ^Fish/Bettas$ http://www.YourURL.com/Fish/Betta-Fish [R=301] | |
| Save changes and view site for errors. | |
| Note: If your store has disappeared and replaced with error messages then check your code. The most likely cause of this is having the last line of the RewriteRule broken into two lines in your .htaccess. For example, the following will cause errors: | |
RewriteRule ^Page/SubPage$ | |
| The above example should be a single space between the old location and the new location, like this: | |
| |
| Add additional redirects, as needed. | |
| You may find that you have more than one page you want redirected. All you need to do is follow step one again. Put any additional redirects under the first one you added. | |
| Save changes and view site for errors. | |
This may seem a little confusing at first but once you get the hang of it it’s pretty easy.
Rochelle
Hi Rochelle,
I just checked one of my BANS website and the 404 error page stats
showed 259 errors. Some are indicated below:
/Air-Systems-and-Accessories/cgi.ebay.com%2FICD-PROMASTER-PARTS-KIT-FOR-PROMASTER-PAINTBALL-GUN_W0QQitemZ320225816512QQcmdZViewItemQQssPageNameZRSS%3AB%3ASRCH%3AUS%3A101 1 –
/paintball-masks/cgi.ebay.com%2FV-FORCE-PROFILER-THERMAL-PAINTBALL-MASK-VFORCE-CHARCOAL_W0QQitemZ310028454338QQcmdZViewItemQQssPageNameZRSS%3AB%3ASRCH%3AUS%3A101 1 –
/paintball-masks/cgi.ebay.com%2FTWO-BERETTA-PAINTBALL-AIRSOFT-GUNS-PISTOL-Gun-Laser-BB_W0QQitemZ110227675392QQcmdZViewItemQQssPageNameZRSS%3AB%3ASRCH%3AUS%3A101 1 –
/cgi.ebay.com%2FJT-Spectra-Flex-8-Paintball-Mask-Camo-w-Thermal-Lens_W0QQitemZ290210767994QQcmdZViewItemQQssPageNameZRSS%3AB%3ASRCH%3AUS%3A101
In looking over your instructions above I guess I would have to have a
redirect for each entry? I hope not. Is there anyway to fix this or does
it need to be fixed? Does it hurt anything by getting those 404 error pages?
Thanks,
Phil
Phil,
Have you done the v3 fix #1 yet? If not I strongly suggest you do. If fixes several bugs, including one that causes 404 errors.
Rochelle
Hi Rochelle,
These are v2 sites.
Phil
Phil,
You probably will want to redirect each of the pages that are getting these errors. Will it hurt to not do this? It depends on how you look at it. If these invalid links are indexed people are going to click them thinking they will go to place A and end up in place B. It will confuse visitors expecting place A. But, they will end up on your site.
I admit to being really anal about things like this and I would take the time to do the redirects. It makes your site that much more professional.
Rochelle
Hi Rochelle
Where is this v3 fix #1 – having issues with 404
thx
Anton,
I’m not clear on what you are asking, but I think you want to download the BANS v3 fix #1? If so, you can download the latest BANS releases at http://buildanichestore.com/update/
Rochelle
[...] for every single page on your site! You can do this by following the instructions found at How to Redirect Deleted or Renamed URLs to New Pages with a 301 Redirect. When you follow these instructions you will create the 301 redirects on the .htaccess for the [...]
Rochelle,
any chance you could explain how to do a redirect from a www. address to a no www. one? I found various codes to that effect on the net, tried a few but my stores still do not redirect. I am stumped.
Fuerza y Fes last blog post..Korean Guitars – North Korean Stratocaster ?
Thank you SO much! I found out that the issue I was having was a spelling error in my previous attempt at a redirect. Thank you so much for having helpful links to explain things in detail to us starting out!