Do I need to do a 301, as well as adding re-write rules on Apache
-
I'm sure this has probably been asked somewhere before...
We're implementing a URL re-write rule to convert non dub pages to the www. subdomain and also removing all trailing slashes as part of a basic canonicalisation exercise.
The question is, as well as doing the URL rewrites within htaccess, should I also 301 those duplicate pages or does the URL rewrite do the job on it's own?
Thanks mozzers.
-
Eric's answer was perfect. After launch, I also do a site:nameofdomain.com and click on a random sampling of links to make sure the rules work perfectl (this is more useful if the page name changes). Good luck!
-
The URL rewrite "should" take care of it. So, when you enter www.domain.com/page.html it would 301 redirect to domain.com/page.html (or vice versa). Once you have the rewrites in place, then test them by going to a page and see if it redirects properly. Use a http server header checker to see if it's serving up a 301.
Even though the internal links may be using your preferred domain, then you'll want to make sure that anyone requesting (or linking to) the "wrong version" will be 301 redirected to the right version of the page.
Also, I would go into Google Search Console and make sure you tell Google which version is your preferred version: the www or non-www version of your site.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Site shows up after re-indexing, then disappears.
I have a site, natvest.com, with which I sell real estate in Alabama and Georgia. I need to show up in an "Alabama Land for Sale" search. Same thing for Georgia. If I re-index my site, I show up for roughly one day, before disappearing again. Happens every time I re-index. Ideas?
Intermediate & Advanced SEO | | natvest0 -
301 Redirects to relative URLs not absolute a problem?
Hi we recently did a migration and a lot of content changed locations see: https://d.pr/i/RvqI81 Basically, the 301 goes to the correct location but its a relative URL (as you can see from the screenshot) rather than absolute URL. Do you think this is a high priority issue from an SEO standpoint, should we get the developer to change the redirects to absolute? Cheers.
Intermediate & Advanced SEO | | cathywix0 -
Do I need to worry about sub-domains?
Hi Moz commnity, Our website ranking was good and dropped for couple of recent months. We have around 10 sub-domains. I doubt them if they are hurting us. Being said all over in SEO industry like the sub-domains are completely different websites; will they hurt if they are not well optimised? And we have many links from our sub-domains to website top pages, is this wrong for Google? How to well maintain the sub-domains? Do I need to worry about them? Thanks
Intermediate & Advanced SEO | | vtmoz0 -
IP Canonicalization - Is this needed?
Hi Wondering if we need to worry about IP Canonicalization via htaccess and if this is really required? and does would it have a big impact?
Intermediate & Advanced SEO | | Cocoonfxmedia0 -
Massive URL Migration with thousands of 301
Hey Everyone! I'm currently working on a project that we have A Lot of product pages and we have thousands of URL's that need to be 301'd over. I know this can be a major issue and could lead to tons of errors. What is everyone's thought of doing such a huge Migration, Should I do it all in phases? or should I do them all at once so they can all be indexed together? What would you suggest to be the best way to go about doing such a massive migration?
Intermediate & Advanced SEO | | rpaiva0 -
Why isnt my crawl results showing a 301 redirect even though I have a 301 rewrite in my .htaccess file?
Ive searched the previous Q&A's & cant find an answer so I;ll ask it here 🙂 crawling my site shows isnt the 301 redirect that i have from my non www to my www domainIts only showing all the results for my www subdomain.As i'm new to SEO & SeoMoz I dont fully understand. Any help would be greatly appreciated because my site is like 2 & a half years old & i'm trying to learn seo so I can rank higher in the serp's. Thanks
Intermediate & Advanced SEO | | PCTechGuy20120 -
301 Redirect using rewrite rule in .htaccess
Hi guys, I have these types of URLs with the format below that are seen as duplicate contents http://www.mysite.com/index.php?a=11&b=15&d=3&c=1 I wanted to permanently redirect them to my homepage. I am thinking if this is possible in .htaccess using rewrite conditions? Thanks in advance...
Intermediate & Advanced SEO | | Trigun0 -
What will happen after I 301 this domain?
A while back I created a new website. Somehow my "scratch" copies of the site got indexed even though I didn't have links built to them. (In the future I will use noindex tags when I am playing around with designing). Now, I have three versions of the site online...let's call them TheRealSite.com and Practice1.com and Practice2.com. Practice1.com and Practice2.com now rank #1 for their main keyword. (It's a relatively uncompetitive niche). TheRealSite.com is somewhere lower than page 20 despite having an exact keyword match domain name. I'm assuming that Google considered it duplicate content as it is the exact same thing as Practice1 and 2. I had considered simply removing Practice1 and 2 from the server, but I was worried that if I did that, I would lose my #1 rankings if TheRealSite didn't recover. So, what I've done is 301 redirect Practice1 and Practice2 to TheRealSite. I'm guessing that over time TheRealSite will come back to #1 and then I can just remove the files from Practice1 and Practice2. Is this the best way to handle this situation?
Intermediate & Advanced SEO | | MarieHaynes1