.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
-
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 -
.ASPX extension - individual redirects per page or....?
We have a few pages that have visible .aspx extensions. I am not as concerned with them showing as I am with the following: https://www.example.com/company.aspx - goes to Company page
Technical SEO | | MichaelEka
https://www.example.com/company - goes to homepage (should go to company page) My dev tells me that the only way to get these two pages to go to the same place would be to set up individual redirects. Is he right? That seems like it could be detrimental to SEO. Is there other code to manage this? Thanks folks.0 -
Does a GTLD extension 'count' as part of the target keyword?
Hopefully someone can shed some light on this for me. Reading about GTLDs, I came across this quote from TSO Host: 'What we don’t know is whether an extension can double up as a keyword, which is picked up by Google and treated identically to the rest of a domain name. I.e. - would ‘bristolguitars.music’ have more ranking potential than ‘bristolguitars.com’ as ‘music’ is a relevant search word?' Source: https://www.tsohost.com/blog/how-do-new-gtlds-affect-seo Does anyone know if a GTLD extension does double up as a keyword? For example, if Nike buys 'Nike.shoes', does this double as the keyword 'Nike shoes', or is Google and other search engines just looking at the domain name _before _the GTLD extension? I'm looking at .photography for examples (not my niche) and seeing folks are having mixed results ranking for 'Keyword + Photography', so would be keen to hear your thoughts.
Technical SEO | | ecommercebc0 -
Html V magento
Please excuse what seem like a naive question we are In process of updating our site from old fashioned html pages to magento store. Our html page ranks well and I don't want to upset the spiders when they find something different. We are keeping all the same content images etc. Is there any reason the magento page should not do as well as the existing html. URL is staying the same. We are think of replacing a few pages at a time rather than replacing everything on one go. Is that necessary?
Technical SEO | | Discountdisplays0 -
I am getting html validation errors on my schema, is there something I've done incorrectly?
When I tried to validate my html after added some schema, I am getting html validation errors. I have some examples below. Any ideas on what I've done incorrectly? www.mexpro.com Line 9, Column 80: there is no attribute "itemprop" `…ontent="http://www.mexpro.com/mexico/images/mexpro-logo.jpg" itemprop=**"**logo" />`_L Line 130, Column 23_: "itemscope" is not a member of a group specified for any attribute `itemtype="http://schema.org/Organization">`
Technical SEO | | RoxBrock0 -
Do index.php extensions count as duplicate content on Joomla sites?
When i run my error report, i see 2 duplicate pages, but both are the main domain and then the /index.php extension. how do i fix this? does it really count as duplicate content?
Technical SEO | | valetseo0 -
Leaving Comments on blogs when html is removed
I found the following blog. It is pagerank 5 do follow http://www.unssc.org/web1/programmes/rcs/cca_undaf_training_material/teamrcs/forumdetail.asp?ID=32 If you attempt to leave a comment with html, the html is removed. There is a button which allows you to leave a comment but if you do it gets redirected to the domain of the blog not your site. However there are still people leaving links with the url of the intended site. As late as today. look at this comment
Technical SEO | | mickey11
Comment posted by : Alex on 09/09/2011 I love to se percorsi on this site very often How is this done, if anyone knows I got the code done to this your keywords The important part being mce_real_href0 -
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