Clear redirect rules / rewrite rules through SEO?

I am going to work on a retail product website that has been around for about 10 years. The website is very familiar with Google search results. The website has changed a lot over the years, so itโ€™s not surprising that their .htaccess file contains 301 redirects and rewrites. There are so many rules that it is a pain. Sometimes there are three different legacy URLs that 301 redirect to the same destination. I am concerned that this file will become a nightmare in order to maintain the road.

Does the web developer reach the point where he wants to remove the old redirect rules and rewrite them to simplify maintenance through SEO? Or does Google have a copy of 301 redirects on the site, in which case I can remove them from my .htaccess file without any SEO penalties?

How does a developer deal with a dirty / long .htaccess file?

+4
source share
3 answers

You are stuck with them. Think about it. If another site has a link that goes here:

http://www.example.com/oldpage.html

And you have this:

http://www.example.com/newpage.html

What happens if you delete this 301 (and oldpage.html does not exist)? Most likely, your site will return a 404 error, which will result in the removal of Google links (and "juice links") to your site. Thus, SEO reduction.

As far as I know, Google does not โ€œrememberโ€ the old 301 redirects. Because what happens if you recreate oldpage.html? If Google remembered 301, then oldpage.html will never be indexed.

+3
source

One option is to reset all old redirection rules to an external file.

RewriteMap oldurls txt:S:\rewritemaps\oldurls.txt [NC] RewriteRule ^(.*\.asp)$ ${oldurls:$0} [NC,L,R=301] 

The second option is to consolidate the rules. The rules below ...

 RewriteRule ^/about/page1.asp /about [NC,L,R=301] RewriteRule ^/about/page2.asp /about [NC,L,R=301] RewriteRule ^/about/page3.asp /about [NC,L,R=301] 

can be combined in:

 RewriteRule ^/about/page(.*).asp /about [NC,L,R=301] 

Ultimately, search engines will start caching destination addresses, so the original Urls will be less important. I think Google is gradually moving the Rank page of the old Url to the new Url. To check if forwarding rules are used, try adding requests to them in accordance with ISPAI rules. You can track queryStrings in Google Analytics.

 RewriteRule ^/oldurl /newurl?redirect [NC,L,R=301] 

People probably have old bookmarks, links from other sites, etc., so you may not want to delete the rules, even if they are not used. You can check if there is one that links to you in Google webmaster tools .

0
source

I would say using the URLRewriting map or the functionality built into IIS 7.0. This should make it more convenient to maintain, and you will not have a link that is dark.

0
source

Source: https://habr.com/ru/post/1302418/


All Articles