301 redirect from .html to non .html?
-
Previously our site was using this as our URL structure: www.site.com/page.html. A few months ago we updated our URL structure to this: www.site.com/page & we're not using the .html.
I've read over this guide & don't see anywhere that discusses this: http://www.seomoz.org/learn-seo/redirection.
I've currently got a programmer looking into, but am always a bit weary with their workarounds, as I'd previously had them cause more problems then fix it. Here is the solution he is looking to do:
The way that I am doing the redirect is fine. The problem is of where to put the code. The issue is that the files are .html files that need to be redirected to the same url with out a .html on them. I can see if I can add that to the 404 redirect page if there is one inside of there and see if that does the trick. That way if there is no page that exists without the .html then it will still be a 404 page. However if it is there then it will work as normal. I will see what I can find and get back.
Any help would be greatly appreciated.
Thanks,
BJ
-
Sha,
I wanted to send a quick update & see if we're on the right track? After implementing this 301 redirect, I'm seeing a few negatives, but also a few positives & would appreciate your feedback:
Concerns:
-
Google Organic Traffic has dropped by 26.65% since we implemented the redirect (12 Days).
-
Top Content Pages From Search Traffic has dropped from a weekly average of 1,500 pages to 998. I've segmented the Analytics to see if I had more or less pages that were driving traffic to my site (Organic Only).
Positives:
-
Bing Organic Traffic is up 32.15% although not substantial for our overall traffic, but it has increased.
-
Yahoo Organic Traffic is up 26.53% less traffic than Bing, so not substantial.
-
Webmaster Tools Pages crawled per day: http://screencast.com/t/krkD69bj3mG we've had a huge spike, which I'm assuming is a good thing & a direct correlation to the 301 redirect.
All this being said, are we on the right track? The initial traffic loss had me worried, but after seeing the crawl stats it gave me hope? Do i just need to be more patient to see this through? Are we missing anything, or is this what you would expect?
Thanks,
BJ
-
-
Happy to help
If you strike any issues let me know.
Sha
-
Thanks for all the help Sha! We'll play with the example code that you'd sent & see what we can come up with. After a few weeks I'll continue to watch our organic rankings & see how it affects us overall.
Thanks,
BJ
-
Not having seen the code your programmer intends to use, that is not possible to say definitively. That is why we built the test for you, so that you can see the code.
If you take a look at the code you will see that the Rule is writing 301 redirects if the conditions are met.
A .htaccess file is read from top to bottom. The first condition matched will be the one used.
Basically, you have one set of files on your server, all of which have the extension .html.
When a request is made, you are asking the server to load the .html file in the browser, but rewrite a "pretty URL" for the user to see in the Address Bar.
So, there are three possible scenarios for a request:
- the user requests /page.html (server loads.html and rewrites the URL to /page)
- the user requests /page (server 301 redirects request to /page.html, loads it in the browser and rewrites the URL to /page)
- the user requests a page that does not exist on the server (server 301 redirects the page to /404.html, loads it and rewrites the URL to /404)
Personally, I would not be going out of my way to rewrite simple URL's just to remove the .html extension, but that is your choice, and I am assuming there is more to it and you had some good reason for doing this in the first place.
The one thing you need to be cautious of in making these types of decisions is that chopping and changing from one thing to another and back again is not a great idea. A 301 redirect should really only be used when you are sure that you want to make a permanent change.
Hope that helps,
Sha
-
My fear with this approach is how the search engines will handle the redirect? I know that from the users perspective this should work, but I've never read any articles that even resemble this type of approach.
Do you believe that this method will pass the value along in the search engines & treat it as a proper 301 redirect.
Thanks,
BJ
-
Hi BJ,
From the information you included here it seems your programmer's approach is sound.
We made a demo for you with a working test and example code for the .htaccess so that you can check that it will achieve your aim in any likely scenario.
Take a look at 301 Redirect and URL Rewrite Example
Hope that helps,
Sha
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
-
Will this 301 redirects help me?
Hello, recently, I found out about all the SEO advantages from 301 redirects. I had 3 websites that are now expired, their topic was Counter Strike 1.6 servers. All of these websites were registered 9 years ago and have few good backlinks (from website with 1%-3% spam score and DA 30+). Now I have one website that is not only about Counter Strike 1.6 but also many other Steam shooter games. If I revive these 3 old domains and 301 redirect them to my new one, will it help me with SEO and increase my ranking on Google?
Intermediate & Advanced SEO | | Bonito19930 -
301 Redirect from Authoritative but Loosely-Related Domain
We acquired a health-related blog about a year ago with good domain authority and a pretty strong link profile (TF ~40). We have been publishing good relevant content in it but it's not really paying dividends and we are considering doing a 301 to our money site, which is focused primarily on senior issues but has a lot of health-related content. The question is - with the two domains only being loosely related in subject matter, do we stand to harm our main site by redirecting from the other domain?
Intermediate & Advanced SEO | | sa_787040 -
301 redirection help needed!
Hi all, So if we used to have a domain (let's say olddomain.com) and we had a new site created at newdomain.com how do we properly setup redirects page to page. Caveat, the urls have changed so for instance the old page oldomain.com/service is now newdomain.com/our-services on the new site. Do we need to have hosting on the old site? Do we need to setup individual 301s for each page corresponding to the new page? Just looking for the easiest way to do this CORRECTLY. Thanks, Ricky
Intermediate & Advanced SEO | | RickyShockley3 -
Relaunching website in two phases - 301 redirect approach
Hey Mozzers, Interested to know your thoughts on the following situation. I am relaunching a website with an updated URL structure in TWO phases. Phase one will be a much smaller version of the site, with 30% of the pages going live - the remaining 70% of page won't be available until Phase two. In Phase one, these 30% of pages will be 301 redirected from their like-for-like versions - old site to new site. The remaining 70%... because the like-for-like pages won't be available until Phase two, which is likely to be launched in 3 months time, should I do a temporary redirect on these pages (302) to the new homepage for the time being, until the new versions of the pages are live - and then implement the 301 from old url to new url. A bit of a messy situation, and not ideal for SEO, but my hands are tied as the organisation is pushing ahead with this phased approach. So, interested to hear your thoughts on an appropriate 301 migration plan.
Intermediate & Advanced SEO | | RWesley0 -
301 Redirecting from domain to subdomain
We're taking on a redesign of our corporate site on our main domain. We also have a number of well established, product based subdomains. There are a number of content pages that currently live on the corporate site that rank well, and bring in a great deal of traffic, though we are considering placing 301 redirects in place to point that traffic to the appropriate pages on the subdomains. If redirected correctly, can we expect the SEO value of the content pages currently living on the corporate site to transfer to the subdomains, or will we be negatively impacting our SEO by transferring this content from one domain to multiple subdomains?
Intermediate & Advanced SEO | | Chris81980 -
HTTPS Login on HTTP Site | 301 or 302 Redirect?
I've searched the forum on this and online and can't seem to find a definitive answer. Some e-commerce sites that are http use a 302 redirect to the https login while other sites use a 301 redirect. I know 302 is generally not recommended but in this case it may make sense. Can anyone advise on the correct practice?
Intermediate & Advanced SEO | | CallMeNicholi0 -
Lost all ranking after site-wide 301 redirect
Hi all I did a complete site-wide 310 redirect about 3 weeks ago for a site that had consistently been in Pos 1-5 for my targeted keyword ("low glycemic foods"). I changed the domain from low-glycemic-foods-org to low-glycemic-diet.com because I thought that was a more appropriate title and thru my readings I believed that if I carefully followed the recommended procedures I would quickly regain my SERP. Webmaster tools is showing that I have over 800 inbound links - many from very trustworthy sources including .edu, etc BUT my home page is nowhere to be found for the keyword search "low glycemic diet". My Seomoz onpage SEO score is an "A" Any enlightenment would be much appreciated.
Intermediate & Advanced SEO | | veezer0 -
301 Redirect With A Message And Delay
Hello, I'd like to sell a site I own. I'd like the site to be redirected to the buyers site with a 301 redirect. But I'd like the viewer to be informed that the site was purchased by this company and they will be redirect in 5 seconds.I'd like for the redirect to be a complete 301 and pass as much linklove as possible. Are you familiar with how to do this? Thanks, Tyler
Intermediate & Advanced SEO | | tylerfraser0