.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
-
Redirecting old html site to new wordpress site
Hi I'm currently updating an old (8 years old) html site to wordpress and about a month ago I redirected some url's to the new site (which is in a directory) like this... Redirect 301 /article1.htm http://mysite.net/wordpress/article1/
Technical SEO | | briandee
Redirect 301 /article2.htm http://mysite.net/wordpress/article2/
Redirect 301 /article3.htm http://mysite.net/wordpress/article3/ Google has indexed these new url's and they are showing in search results. I'm almost finished the new version of site and it is currently in a directory /wordpress I intend to move all the files from the directory to the root so new url when this is done will be http://mysite.net/article1/ etc My question is - what to I do about the redirects which are in place - do I delete them and replace with something like this? Redirect 301 /wordpress/article1/ http://mysite.net/article1/
Redirect 301 /wordpress/article2/ http://mysite.net/article2/
Redirect 301 /wordpress/article3/ http://mysite.net/article3/ Appreciate any help with this0 -
.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 -
If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect?
If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect? If this scenario requires a 301 redirect no matter what, I might as well update the URL to be a little more keyword rich for the page while I'm at it. However, since these pages are ranking well I'd rather not lose any authority in the process and keep the URL just stripped of the ".html" (if that's possible). Thanks for you help! [edited for formatting]
Technical SEO | | Booj0 -
Wordpress versus html and google ranking
My current SEO has always recommended that I take my site to wordpress. I really don't want to move to wordpress. I don't like it... I just like writing code in raw html, css, and script. I feel like I have more control that way. Wordpress just seems like a platform for blogs (I have my blog in wordpress). My question is, do wordpress websites typically rank better? Is there benefit to moving to it?
Technical SEO | | CalicoKitty20000 -
SEO changing from Wix Flash too Wix HTML
I have a Wix flash website www.theonlinefloorwarehouse.com.au which is number one in Google search for most of our main products Due to having a large number of changes and the draw backs with flash I pads etc I have rebuilt it in Wix HTML temporarily under this URL www.laminateflooringperth.net.au/ Now I find out Wix uses Ajax technology which most people say is useless for SEO after months of work I do not know weather to switch to the HTML site or not perhaps I should use both sites ? Has any one switched to HTML from Flash, was there a drop in or higher rankings ? Any advice would be greatly appreciated Regards John
Technical SEO | | johnnewson0 -
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 -
HTML and no index, follow
I’m just learning about HTML and I was wondering can a tag be put into a dynamic HTML page?
Technical SEO | | EricVallee340