.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
-
Html extensions
I have remodeled an old html site using wordpress. I see some instructions in wordpress that says I can add an .html extension to some of the pages, but it looks pretty complicated. Is there any benefit in going through that hassle? or should I just ask my web guy to rewrite via htaccess | https://sacramentotop10.com/Weddings/Dresses.html | https://sacramentotop10.com/Weddings/Dresses.html becomes https://sacramentotop10.com/weddings/dresses
Technical SEO | | julie-getonthemap0 -
Why add .html to WordPress pages?
A site I may take over has a plugin that adds .html to the pages. I searched online but I’ve only found how to add it rather than why to add it. Is it needed? If I remove it, I’ll have to be careful with SEO / indexed pages and redirects. The site is running 3.x.x and 90% of the plugins have not been updated in over 5 years including this one. Before I update to 4.7.x, I am trying to understand the landscape (pros / cons) on why something could be used and if I need to find a suitable replacement for it.
Technical SEO | | acktivate2 -
Does the domain extension effect domain authority and ranking
We have produces a website on a .company domain extension. We have produced a good sized website with unique content. However the DA remains at 1. There are no high priority issues in the page crawl. We suspect that the domain extension may be causing a lower DA. Is this a ranking factor?
Technical SEO | | easydomains0 -
Site rebuild without HTML extension = broken links?
I have a client and his site is pure HTML. He made huge amount of link building with some hundreds of links point to example.com/target.HTML Now we decided to use WordPress with the same site structure. If we use the exact same URLs but without the HTML ending will it cause broken links? Is there any best practice for this kind of change? Many thanks for any idea!
Technical SEO | | seozoltan0 -
Canonicalization of index.html - please help
I've read up on the subject but am new at this so I thought I would just put forth a simple question. We want our home page to be referred to as www.domain.com. We want the search engines to find and return this URl in search results. But the page has to have a name and the actual name is NOT to www.domain.com/index.html. This, I believe is what can cause duplicate cotnent issues (not really duplicate but perceived by the serach engines as duplicate content). Is it best to insert http://www.domain.com/" /> in the HEAD section of the index.html page or am I totally misunderstanding this concept?
Technical SEO | | TBKO0 -
Changing .html to .asp in URLs
Hi Mozzers, I have a question. The webmaster of a client of mine needs to make changes to some files which will effect the URL's. Essentially everything is staying the same but the end of the URL will change from .html to .asp. This is because the site will be dynamically loading content (perhaps from a database) (i.e. latest news to come from their blog etc..) In order to do this we would need to change the filenames of the whole website. (i.e. personnel.html would become personel.asp). Changing URLs can harm indexation but a small change to the end - would Google drop these pages? A 301 redirect is not possible from old URL to new. What impact would this have on Rankings? Thanks Gareth
Technical SEO | | Bush_JSM0 -
How much impact does bad html coding really have on SEO?
My client has a site that we are trying to optimise. However the code is really pretty bad. There are 205 errors showing when W3C validating. The >title>, , <keywords> tags are appearing twice. There is truly excessive javascript. And everything has been put in tables.</keywords> How much do you think this is really impacting the opportunity to rank? There has been quite a bit of discussion recently along the lines of is on-page SEO impacting anymore. I just want to be sure before I recommend a whole heap of code changes that could cost her a lot - especially if the impact/return could be miniscule. Should it all be cleaned up? Many thanks
Technical SEO | | Chammy0 -
Restaurant menu SEO: PDF or HTML?
Is it better to use a PDF or hard code restaurant menus (or any document for that matter) in HTML? I want the content to be indexed and thought PDF was the way to go for several reasons, but I wanted to get confirmation on this before I move forward.
Technical SEO | | BostonWright0