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
-
Need advice on redirects
Hi, I have new web addresses for my subpages. None if them have external links. Should I do redirects to the new pages or just leave the old pages in 404 and let google crawl and rank the new page. I am asking because my current pages don’t have a good ranking and I am thinking starting with a clean url is better. Thank you,
Intermediate & Advanced SEO | | seoanalytics1 -
Rel canonical or redirect
Hi, my client has the following links pointing to the home page http://www.weddingrings.com/index.cfm http://www.weddingrings.com In this case would I use rel canonical or redirect?
Intermediate & Advanced SEO | | alexkatalkin0 -
301 redirect recommendations
One of our clients we are working on have two sites the main with a PR5 and a separate one with a PR4. We are planning on doing a 301 from the PR4 to a page on the PR5 Is it best to do: www.PR4.com ----> www.PR5.com/releveantPR4page or www.PR4.com/page ----> www.PR5.com/releveantPR4page Most pages on the PR4 site can fit into one PR5 page logically. However the PR4 has an about us, contact us, blog/with posts, FAQ, Applications, Legal Resources which are all pretty out dated.. The PR4 site is kinda messy and we are not sure if it will be easy to 301 each page individually with the user in mind. can we do a sitewide 301 redirect from the root PR4.com to a page PR/5.com/releveantPR4page and also do deeper 301's? PR4.com/PR4page ---> PR5.com/releveantPR4page
Intermediate & Advanced SEO | | Bryan_Loconto0 -
Redirection not working
http://elmanarah.com/ to http://www.elmanarah.com/ I have mistakenly created 5 databases for one wordpress installation.In order to get rid of them I mistakenly even deleted the right one.Now created the new one but the URL is showing with www Even now if It type in http://elmanarah.com/ it sends me to http://www.elmanarah.com/ I also check in URL D.A and P.A in OSE it shows like I have redirected it fine.Can anyone Check in and guide me either I have done it right and It pass on my previous work effort or it was total loss for me?
Intermediate & Advanced SEO | | csfarnsworth0 -
301 Redirect Dilemma - Website redesign
Hi Guys, We are redesigning a clients ecommerce site. As part of the process, we're changing the URL structure to make it more friendly. I have put together a provisional 301 redirect plan but I'm not sure just how far I need to go with it. So far I have extract all the pages from the existing site that Google Webmaster Tools says have links pointing at them - this totals 93 pages. I have matched each page like for like to the new website structure. My next step was to pull the landing pages report from Google Analytics, I have extracted the pages that received entrances over the last 6 weeks. This totals 553, less the redirects I have already done and cleaning up some Google Translate pages I have circa 410 pages left. Many of these pages has more than 1 URL pointing to that page. I'm debating how important it is that that all of these remaining 410 pages have individual redirects set up for them one by one. I have to rule out regex because there is no pattern that makes sense given that I have already set up redirects for the first 93 pages that have external links. My question therefore is how important are 301 redirects on pages that have no external links and receive less than 10 entrances over a 6 week previous period? Do I need to 301 every single product on the old site to it's corresponding page on the new site? Also, I'm not sure how to treat pages that have mutliple URL's on the old site, the existing URL structure is such a mess that in some instances I have 5 URL's for one product page? I could feasibly create 5 seperate redirects but is this necessary? Also what about speed considerations, the server is going to have to load these redirects and it may slow the site down. I'm sitting at 100 odd so far. Any answers are most appreciated. Thanks Derek.
Intermediate & Advanced SEO | | pulseo0 -
301 redirect from one domain to other domain, How To?
Hi, I need to redirect 150 products pages from http://www.filtrationmontreal.com/ to http://www.furnacefilterscanada.com/ How can I do this? Is there a tool or anything I can do to do 301 from one domain to another one? Can I use Google Webmaster Tool? Thank you, BigBlaze
Intermediate & Advanced SEO | | BigBlaze2050 -
301 doesn't redirect a page that ends in %20, and others being appended with ?q=
I have a product page that ends /product-name**%20** that I'm trying to redirect in this way: Redirect 301 /products/product-name%20 http://www.site.com/products/product-name And it doesn't redirect at all. The others, those with %20, are being redirected to a url hybrid of old and new: http://www.site.com/products/product-name**?q=old-url** I'm using Drupal CMS, and it may be creating rules that counter my entries.
Intermediate & Advanced SEO | | Brocberry0 -
Is it ok to use both 301 redirect and rel="canonical' at the same time?
Hi everyone, I'm sorry if this has been asked before. I just wasn't able to find a response in previous questions. To fix the problems in our website regarding duplication I have the possibility to set up 301's and, at the same time, modify our CMS so that it automatically sets a rel="canonical" tag for every page that is generated. Would it be a problem to have both methods set up? Is it a problem to have a on a page that is redirecting to another one? Is it advisable to have a rel="canonical" tag on every single page? Thanks for reading!
Intermediate & Advanced SEO | | SDLOnlineChannel0