301 Redirect from .html
-
Hi there,
Following on from this post:
http://moz.com/community/q/help-with-duplicated-contentPlease could one confirm that using the following code in our htaccess file will stop the duplicated content issue we are having.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+.)+html?\ HTTP
RewriteRule (.+).html?$ http://www.bereavementstationery.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.htmlKind Regards
Alec
-
If I understood correctly you changed all your urls from ending with .html to ending with /
Please confirm you previously had the following urls:
http://www.domain.com/somepage.htmland now you have:
http://www.domain.com/somepage.htmlIf the above is correct the code I use to do the redirects is:
RewriteEngine On
RewriteRule (.+).html$ /$1/ [L,R]
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 has 302 redirects for HTTP to HTTPS when it should be 301
Hey all, In the latest Moz crawl, certain pages on our website have shown as having 302 redirects for the http to https, but not all. There should be a 301 solution, but wanted to see if anyone had any advice or guidance. Thanks!
On-Page Optimization | | Julzseo1 -
How long should I leave an existing web page up after a 301 redirect?
I've been reading through a few of blog posts here on moz and can't seem to find the answer to these two questions: How long should I leave an existing page up after a 301 redirect? The page old page is no longer needed but has pretty high page authority. If I take the old page down—the one that I'm redirecting from—immediately after I set up the 301 redirect, will link juice still be passed to the new page? My second question is, right now, on my index.html page I have both a 301 redirect and a rel canonical tag in the head. They were both put in place to redirect and pass link equity respectively. I did this a couple years back after someone recommended that I do both just to be safe, but from what I've gathered reading the articles here on moz is that your supposed to pick one or the other depending on whether or not it's permanent. Should I remove the rel conanical tag or would it be better to just leave it be?
On-Page Optimization | | ScottMcPherson0 -
301 Redirect and SEO Rankings
I recently restructured my webpage URL's (about 300 ~ 75% of my total website) to make the URL paths more SEO friendly. Within a few hours of restructuring the pages, I did a 301 redirect to my old URL's and pointed them to the new pages. I have seen ~ 50% drop in organic traffic. I started the restructuring exercise 14 days ago and finished it a few hours back. I have 3 questions: How long will it take for me to recover my old traffic. Will I recover most of it or some of it? Due to a glitch in the specified path, some old URL's were wrongly redirected (this happened with 9 pages to be exact). I will explain exactly what happened: www.redirct.com/superseonow1 ---- redirected to ---- www.redirectnow.com/seonow1 **/superseonow was 301 redirected to /seonow. After 3 days I realize that /superseonow1 was actually /supernow1. The same thing happened to 9 pages - /superseonow2, /superseonow3 ..... ** I have removed all the wrong redirects. When I tried to enter the correct (old) paths now and 301 redirect them to the new paths, the page was not found using the old paths. Should I redirect the old paths to the New ones even now? 3. Finally, in how much time after you change the page structure should you use the 301 redirect. Since I had two different teams working on this job, there could have been up to a 24 hour gap between the redirection.
On-Page Optimization | | rajatsharma0 -
Is it redundant to include a redirect to my canonical domain (www) in my .htaccess file since I already have the correct rel="canonical" in my header?
I've been reading the benefits of each practice, but not found anyone mentioning whether it's really necessary to do both? Personally I try to stay clear of .htaccess rewrites unless it's absolutely necessary, since because I've read they can slow down a website.
On-Page Optimization | | HOPdigital0 -
Losing Page Rank after 301 redirect from http to www
Hi Guys I have site-wide redirected all http// to www and all the category pages lost their page ranks (except home page). I would like to know if this is normal and is it one of the possible causes in losing keyword ranking?
On-Page Optimization | | ilovebodykits0 -
Depreciated content - Canononical, 301, or noindex?
I have a page that has existed on our website for many years, without ever being updated.This is what I would consider an "evergreen" content page, but it is now considered out of date and depreciated. It was never ranking high for any keyword in particular, but it is a page that has existed for many years. We have now created a more up-to-date version of the page, with much more informative content, a new URL, and of course it is SEO optimized. I am puzzled as to what I should do with my old page. Should I add a canononical link pointing it to the new updated page, or should I 301 redirect it to the new page, or should I no-index the old page? What are your thoughts and suggestions? I can give more information if needed. Thank you!!
On-Page Optimization | | jcph0 -
Is it ok to point internal links to index.html home page rather than full www
I thought I saw this somewhere on SEOmoz before but I was so busy by the time I got around to work on my SEO on my site, I realized I have this happening and can't recall if it is a problem which takes away from my ranking. If my www.website.com is ranking well but I have internal menu links pointing to www.website.com/index.html instead of www.website.com will that take away from my www.website.com rankings? Should I change all my menu links that point to /index.html to the full website url path www.website.com ?
On-Page Optimization | | Twinbytes0 -
301 redirect and then keywords in URL
Hi, Matt Cutts says that 301 redirects, including the ones on internal pages, causes the loss of a little bit of link juice. But also, I know that keywords in the URL are very important. On our site, we've got unoptimized URLs (few keywords) in the internal pages. Is it worth doing a 301 redirect in order to optimize the URLs for each main page. 301 redirects are the only way we can do it on our premade cart For example (just an example) say our main (1 of the 4) keywords for the page is "brown shoes". I'm wondering if I should redirect something like shoes.com/shoecolors.html to shoes.com/brown-shoes.html In other words, with the loss of juice would we come out ahead? In what instances would we come out ahead?
On-Page Optimization | | BobGW0