.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 Improvements in Webmaster shows many as Duplicate Titles
Html Improvements in Webmaster shows many as Duplicate Titles. As attached they are not duplicates we made a way to make text hyperlinks if the name matches other objects in our site. How can we deal in such case for Google not to this it as 2 different URl's rather they are one. As the ones with ?alinks are just hyperlink URL's Say we have a name as "James" and he has a biography in our site. Say "Gerald" has a Bio as well and we talk about "James" in "Geralds" bio the word "James" gets a hyperlink automatically so when anyone clickes "James" it goes to his bio. k5jDM
Technical SEO | | ArchieChilds0 -
Dynamically serving different HTML on the same URL
Dear Mozers, We are creating a mobile version for a real estate website. We are planning to dynamically serve different HTML on same URL. I'm a little confused about the on-page optimization for the mobile version. The desktop version pages has lot of text content and I strongly believe that made us ranking for various keywords. Now if I'm creating this mobile version do I need to serve all the same exact text content on the mobile version too? I found zillow.com using the same method, their desktop version has lot of text content and mobile version is clean without any text. Does this affect the sites SEO anyway? Please help, share your thoughts. RIyas
Technical SEO | | riyas_0 -
How Google can interpret all "hreflag" links into HTML code
I've found the solution. The problem was that did not put any closing tag into the HTML code....
Technical SEO | | Red_educativa0 -
Duplicate page content - index.html
Roger is reporting duplicate page content for my domain name and www.mydomain name/index.html. Example: www.just-insulation.com
Technical SEO | | Collie
www.just-insulation.com/index.html What am I doing wrongly, please?0 -
Best practices for migrating an html sitemap? Or just get rid of it all together?
We are migrating a very large site to a new CMS and I'm trying to determine the best way to handle all the links (~15k) in our html sitemap. The developers don't see the purpose of using an html sitemap anymore and I have yet to come up with a good reason why we should migrate rather than just get rid of the sitemap since it is not very useful to users. The html sitemap was created about 6 years ago when page rank sculpting was a high priority. Currently, since we already have an XML sitemap, I'm not sure that there's really a need for a html sitemap, other than to maintain all the internal links. How valuable are the internal links found in an html sitemap? And will it be a problem if we remove these from our link profile? 15,000 links sounds significant, but they only account for less than .5% of our internal links. What do all you think?
Technical SEO | | BostonWright0 -
Do Domain Extensions such as .com or .net affect SEO value?
In the beginning of SEO days, it was going around that .com is the best for SEO and that .net is not as good. Is there any truth to this, and what about .org or .edu? I always hear that .edu sites have high PR. Is there any rhyme or reason to this, or all they all equal? Thank you, Afshin Christian-Way.com
Technical SEO | | applesofgold0 -
How to remove .html ending with mos rewrtie
I have a page and I want to remove .html ending from urls. What should I write in the htaccess?
Technical SEO | | sesertin0 -
Is there any value to a home page URL adding the /index.html ?
For proper SEO, which version would you prefer? A. www.abccompany.com B. www.abccompany.com/index.html Is there any value or difference with either home page URL??
Technical SEO | | theideapeople0