.html extension
-
My new client's original web developer set up many pages with .html extensions. My plan is to turn most of these into php pages. Also, I think the .html extension displaying in the browser is just ugly so I want to drop the .html extension from those pages that remain. I know how to do this with .htaccess, but my question is should I 301 redirect all the .html pages to the page without an extension. (For example, should I redirect www.example.com/page.html to www.example.com/page)
I don't know how many, in any, links there are out there to these pages, but I'm guessing not many. I'm sure it's not that big a deal but I was wondering if it would be worth the time to do that for the pages I change.
-
Thanks Thomas but this site only uses wordpress for the blog. The rest of the site is what I'm concerned with right now.
-
-
Great! I think I'll give that a whirl.
-
Absolutely! You can do a blanket "301 any page with .html at the end to the same page without it" rule with .htaccess to save you time and energy once you've done your renaming process.
This neat little bit of code (found at http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url) should do the trick nicely.
<code>RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule^(.*)\.html$ /$1 [L,R=301]</code>
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
-
Can bad html code hurt your website from ranking ?
Hello,For example if I search for “ Bike Tours in France” I am looking for a page with a list of tours in France.Does it mean that if my html doesn’t have list * in the code but only that apparently doesn’t have any semantic meaning for a search engine my page won’t rank because of that ?Example on this page : https://bit.ly/2C6hGUn According to W3schools: "A semantic element clearly describes its meaning to both the browser and the developer. Examples of non-semantic elements: <div> and - Tells nothing about its content. Examples of semanticelements: <form>, , and- Clearly defines its content."Has anyone any experience with something similar ?Thank you, </form>
Technical SEO | | seoanalytics0 -
What is the best program to create an html sitemap?
I already have an xml sitemap, so I've been researching how to create an html sitemap with over 10,000 urls for an ecommerce website. Any program, paid or unpaid, just needs to be created so it looks good to put in the footer of our website.
Technical SEO | | ntsupply0 -
Strange problem with basic html anchor tag linking to my domain
I have some old valuable followed links from high ranking domains and I noticed from moz reports they are reporting 404.Visually they looked fne but when I clicked on those they indeed were generating 404. When I researched further they are defined as My domain.com Notice there is extra space between "/" and the closing quote. It turns out it is sending "www.mydomain.com/ " to browsers. Any ideas How to solve this? If I should put a perm redirect in apache, how do I deal with these "%C2%A0" characters. It seems the issue is happening at more than one remote domain.
Technical SEO | | Maayboli0 -
Keyword place in page HTML code? Higher is better?
Hello, is it important to place keyword more higher in html code Our situation: item page. H1 and all text about this item with keyword mentioned three times is in the end of html code? Competitors pages with info about item, but higher keyword place and description in html code make better in SERPS. Could it be reason? Could we change place of text about item in html code ? Giedrius, Lithuania
Technical SEO | | Patogupirkti0 -
.co.uk/index.html or just .co.uk - my on-page reports are different for both - why?
It looks like the same thing, yet it has a different on-page report for each version - why is this. Please share your ideas with me on this. The original url is http://bath.waspkilluk.co.uk/index.html. Many Thanks - Simon.
Technical SEO | | simonberenyi0 -
Benefits to having an HTML sitemap?
We are currently migrating our site to a new CMS and in part of this migration I'm getting push-back from my development team regarding the HTML sitemap. We have a very large news site with 10s of thousands of pages. We currently have an HTML sitemap that greatly helps with distributing PR to article pages, but is not geared towards the user. The dev team doesn't see the benefit to recreating the HTML sitemap despite my assurance that we don't want to lose all these internal links since removing 1000s of links could have a negative impact on our Domain Authority. Should I give in and concede the HTML sitemap since we have an XML one? Or am I right that we don't want to get rid of it?
Technical SEO | | BostonWright0 -
HTML Forms Dilute Pagerank?
Today, we have way too many links on our homepage. About 30 of them are add-to-basket links (regular html links) pointing to a separate application. This application 302 redirects the client back to the referring page. I have two questions: 1. Does the current implementation of our buttons dilute pagerank? Bear in mind the 302 redirect. 2. If the answer to the first question is yes, would transforming the buttons into form buttons change anything to the better? We would still 302 back to the referring page. I know Gbot follows GET forms and even POST forms, but does GBot pass on pagerank to the form URL?
Technical SEO | | TalkInThePark1 -
How to achieve product extensions in organic serps
I have noticed some interesting changes in how google are returning searches for specific branded products. In this case 'tom ford glasses' position 12 result has three product extensions (see image) This is similar to the product extensions which occasionally occur on adwords. Have you seen this happen and if so any ideas how it all works? TR3nz
Technical SEO | | seanmccauley0