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
-
Reversing the bad effects of a problematic 301 redirect
I have a previously very strong ranking page that is now omitted from the SERPs, but only for one specific keyword phrase. I think I found the reason, which I'll explain, and I hope I can hear some confirmation of my theory and a way to correct it. Let's use the following made up domain and keywords: Political blog SiteA.com had a few news articles about "Blue Widgets" (like 10 out of 10,000 pages). They became exceedingly popular, so on SiteA.com we created a reference-type page about "Blue Widgets" and in the news articles we already had about Blue Widgets we added rich anchor text (Blue Widgets) links that pointed to this new About Blue Widgets page. (long before we wised up about keyword rich anchor texts and Google!) After seeing how much traffic was coming to the About Blue Widgets page, we created a whole new site, SiteB.com, which was about Widgets (not just Blue Widgets), a page for each color of widget, and other pages about widgets. SiteB.com has an important and popular page, SiteB.com/blue-widgets, which is about Blue Widgets. We then 301 redirected the SiteA.com's About Blue Widgets page to SiteB.com/blue-widgets. This page in SiteB.com ranked very high (like #2, #3) for years. Two weeks ago SiteB.com/blue-widgets fell out of the SERPs, but only for the phrase "Blue Widgets". The page still gets lots of traffic from other queries, and even the "Blue Widgets" query will bring up other pages on SiteB.com. So, the only thing hit is the specific query "Blue Widgets" for the specific page SiteB.com/blue-widgets. It seems obvious to me that Google took the combination of a) a site that it probably no longer liked since we sold it (SiteA.com) since it's gone downhill, b) the rich keyword anchor text on SiteA.com pages pointing to the SiteA.com page optimized for that keyword, and c) then being 301 Redirected to a SiteB.com Blue Widgets page optimized for that same anchor text. I only discovered the SiteA.com redirects last week, which I had completely forgotten about, and had them removed right away. My question is, 1) if this indeed was the issue, now that the redirects from SiteA.com to SiteB.com are gone will my ranking eventually go back to normal? and 2) is there anything I can do to get Google to notice the change and have it go back to how it was?
Intermediate & Advanced SEO | | bizzer0 -
Removing 301 redirect from 2.5 yr old domain
Hello, Need Advise. We are in Automobiles We have an Automotive site - build 3 yrs back - which is our main site (Site A) We built a separate niche site on Used cars 2.5 yrs back (Site B - url http://www.usedcarindelhi.com) - did seo - promote it for a year and later on in feb 2013 - did 301 domain redirection to Site A Now - we thinking to rebuild Site Site B again and remove redirection Will there be any harm on Site A, as we have now removed the redirection or shall we pass on link from home page of Site B to Site A i.e say Powered by Site A (on Top) or at all no direct linking is actually needed. PS :- Also - can anyone let know the backlink quality of www.usedcarindelhi.com. Its PR 3, DA - 18, Majestic Citation Flow - 18, Trust Flow - 11 . Pl advise
Intermediate & Advanced SEO | | Modi0 -
Urgent Site Migration Help: 301 redirect from legacy to new if legacy pages are NOT indexed but have links and domain/page authority of 50+?
Sorry for the long title, but that's the whole question. Notes: New site is on same domain but URLs will change because URL structure was horrible Old site has awful SEO. Like real bad. Canonical tags point to dev. subdomain (which is still accessible and has robots.txt, so the end result is old site IS NOT INDEXED by Google) Old site has links and domain/page authority north of 50. I suspect some shady links but there have to be good links as well My guess is that since that are likely incoming links that are legitimate, I should still attempt to use 301s to the versions of the pages on the new site (note: the content on the new site will be different, but in general it'll be about the same thing as the old page, just much improved and more relevant). So yeah, I guess that's it. Even thought the old site's pages are not indexed, if the new site is set up properly, the 301s won't pass along the 'non-indexed' status, correct? Thanks in advance for any quick answers!
Intermediate & Advanced SEO | | JDMcNamara0 -
Cannot 301 redirect, alternatives?
Hi, the company has changed it's name so now under a different domain. All pages have been 301 redirected on a 1:1 basis apart from the home page. For some reason IT cannot 301 redirect the old home page to the new website home page. At suggestions? Perhaps canonical it? Meantime the old home page copy has been changed to say the company name has changed and a link to the new website. Any help greatly appreciated.
Intermediate & Advanced SEO | | Richard5550 -
301 redirect or rel=canonical
On my site, which I created with Joomla, there seems to be a lot of duplicated pages. I was wondering which would be better, 301 redirect or rel=canonical. On SeoMoz Pro "help" they suggest only the rel=canonical and dont mention 301 redirect. However, ive read many other say that 301 redirect should be the number one option. Also, does 301 redirect help solve the crawling errors, in other words, does it get rid of the errors of "duplicate page content?" Ive read that re-=canonical does not right? Thanks!
Intermediate & Advanced SEO | | waltergah0 -
301 Redirect to a new domain, Need linkbuilding ideas
Hi, I just 301 redirected my 3 year old domain to a new domain which was created yesterday. Now i want to start link building to my new domain. Should i start slowly by publishing 4-5 articles on article directories and a 1 press release a week? Can someone suggest me some ideas on how to handle a new domain. Will be waiting for replies.
Intermediate & Advanced SEO | | Dex3783783780 -
HTML entities and SEO
I recently came across an article on HTML entities that discussed how their appear in search results. The same article also mentioned that their use might be considered spam. Since I know nothing of them (other than what I read in the one article) are they a good or bad idea to make meta descriptions stand out from the crowd?
Intermediate & Advanced SEO | | casper4340 -
Confusing 301 / Canonical Redirect Issue - Wizard Needed
I had two pages on my site with identical content. What I did was 301 redirect one page to the other. I also added canonical redirect code to the page that held the 301 code. Here is what I have: www.careersinmusic.com/music-colleges.aspx - this page was a duplicate and I needed it to resolve to:
Intermediate & Advanced SEO | | 4Buck
www.careersinmusic.com/music-schools.aspx Here is the code I used: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX music-colleges.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="music-colleges.aspx.vb" Inherits="music_colleges" %>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml"> http://www.careersinmusic.com/music-schools.aspx"/> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
music-colleges.aspx.vb
Partial Class music_colleges
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "http://www.careersinmusic.com/music-schools.aspx")
End Sub
End Class XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The problem:
For some reason, when the search “music colleges” is done in Google, I am #7. When the term “music schools” is done, I am around 119. I MUST be getting a penalty for some reason, I just cannot figure the reason. When perform well for one term and terrible for the next? All I can come up with is a duplicate content penalty or something along those lines. Also, music-colleges.aspx seems to still be in Googles index, even though the above 301 happened months ago. Thoughts? site:www.careersinmusic.com/music-colleges.aspx Any insight into this would be GREATLY appreciated. Many Thanks!0