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
-
HTML Site SEO (NO CMS)
I have got a client site, which is dated (2007) and has not been shifted to any recognised CMS yet. It is HTML based. Is it possible to SEO on such a site? Is it even worth it? If it is possible to do SEO on this, any suggestions will be highly appreciated. Thank you.
On-Page Optimization | | ArthurRadtke3 -
Html to wordpress
I have an html site and most of my pages are ranking well. I want to switch to wordpress but i am afraid that i will loose ranking on my inner pages. Any thoughts? And should i do a redirect or use a html plugin
On-Page Optimization | | benjaminmarcinc0 -
Would a free PDF download diminish SEO benefits of HTML content?
Hello, I am doing SEO for a company that, as a sideline business, sells four books written by the principals; the content is directly relevant to the company's primary business focus. Book sales are a tiny fraction of our overall revenue, and we don't expect that to change, although we will continue to sell the books. In addition to selling them, we have decided to convert the books to HTML and post them for free on our website (laid out by chapter and section). The hope is that this will result in goodwill, links, traffic, and ultimately improved search rankings. My question: Would offering free PDF downloads of the books (in addition to posting the HTML content) diminish the SEO benefits of the HTML content? If we don't offer the PDF option, people would have to visit our site to read the content (unless they bought a hard copy). If visitors were able to download a free PDF, they wouldn't need to return to our site to read it. If our corporate clients (nearly all of our clients are corporations) could download a PDF, they could then post it on an intranet instead of posting a link to our site. In general, do you think a visitor would be less likely to link to our site if he or she were able to download the PDF? Or would the appeal of the PDF option make it more likely that people would visit and link to the site? Also, if we offer the PDF option, are there any SEO issues related to duplicate content? Finally, if we did offer the free PDF download, would you recommend that we ask for an email address before giving the PDF? Thank you very much!
On-Page Optimization | | nyc-seo0 -
301 directs
How do i determine which of my pages have been indexed by Google? and if they haven't been indexed how is this achieved? Also how do I set up a 301 redirect?
On-Page Optimization | | Hardley1110 -
Boatload of 301 Redirects Question
We have a client that came to us and they recently did a site makeover. Previously they had all their pages in root directory including 75+ spammy article pages. On their makeover, they moved all the article pages into a directory and added 301 redirects. In going over their site we noticed they have redundant articles, like an article on blue-marble-article.htm and blue-marbles-article.htm Playing on singular and plural with dulpicate content for most part with exception to making it plural. If they have 75 articles, Id say 1/3 are actually somewhat original content. I would like to 301 redirect 2/3's of the articles to better re-written article pages but that would add a whole lot more 301 redirects. We would then have a 301 redirect from root directory to article directory, then another 301 redirect from spam article to new re-written article. My question is, would this be too many redirects for googlebot to sort through and would it be too confusing or send bad signals? Or should I create a new directory with all good articles and just redirect the entire old articles directory to the new one? Or just delete the redirects and old spammy directory and let those fall on a 404 error page. Id hate to lose 50-75 pages but I think its in fact those spammy pages that could be why the site fell from top of first page google to third page and now 10th page in a years time. I know, Im confused just typing this out. Hope it makes sense for some good feedback and advise. Thanks.
On-Page Optimization | | anthonytjm0 -
Should we consider redirecting a high ranking subdomain page to our homepage?
My site bluecotton.com sells custom printed t-shirts. Our DA is 46. Our homepage is PA 55. The design studio is where users create their designs. Over the years the design studio has received a lot of fan fair including links from gizmodo and adobe. When I rank against our biggest competitors customink, ooshirts, uberprints.com I find that our domain as a whole doesn't look all that great. However, when I look at the history of our subdomain I see that we are more trusted and credible than all of our competitors. We have 10k links pointing to the design studio. Here is my question. What if I did 301 redirect of bluecotton.com/studio.html to bluecotton.com? Then I created a new url for the DS. This would not cause users any problems. In fact for many they would get more context around what we are trying to do and what we offer. Is this crazy? I never find results in google for the design studio. It always shows our home. That is pretty much what happens to all of our competitors on the higher traffic terms that are driving real sales. So why do i ask? If my subdomain is more valuable becuase of the design studio links then I wonder if I redirected it to the homepage if it would supercharge my homepage and propel is forward in the serps. Thoughts?
On-Page Optimization | | bradwayland0 -
Title, other html tags not showing on onpage reports
Either something is seriously wrong with my website or seomoz is not analyzing my site correctly. When I view the source code for my site (www.myfavoritetoys.com) I clearly see elements such as page title, h1 tags etc. However, on the onpage reports seomoz says these elements are missing. I am not seeing any meaningful data in the reports because it isn't analyzing correctly. Please help!
On-Page Optimization | | mortickles0 -
How do you create a 301 redirect for www.mysite..com/index.html in htaccess.
I understand that it is possible to create a 301 redirect for www.mysite..com/index.html to www.mysite.com. (as well as subdirectories.) How is this accomplished? My hosting company says that setting this up in htaccess will cause "Apache to geti into an infinite loop and the page won’t load." I have read on the forum that this is possible. Any help would be greatly appreaciated. THanks. Perri
On-Page Optimization | | PerriCline0