.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
-
Using "Div's" to place content at top of HTML
Is it still a good practice to use "div's" to place content at the top of the HTML code, if your content is at the bottom of the web page?
Technical SEO | | tdawson090 -
Both links with ".html" and without are working , Is that a problem ?
Default format of my url ending with ".html" , I know it's not a problem .. But both links with ".html" and without are working , Is that critical problem or not ? and how to solve it ?
Technical SEO | | Mohamed_Samer0 -
Whats better? A modified .COM EMD or Pure EMD on a new extension?
HI I am planing to built a site. Lets say my keyword is "playgames". I can take for example the domain playgamesnow.com, filler domain. Or I can take playgames.new extension. A pure EMD. My question is whats better?Is it worth to register the domain on a new ( but suitable ) extension just to be shorter and EMD. Or its better to take the modified.COM ( longer and not EMD ). But its a .com It will be a big site, I plan to make an authority, long lasting site. Thanks in advance!
Technical SEO | | Catinas970 -
Error report in Bing Evaluated size of HTML....
Hi Whilst checking Bing's SEO analyser I got this error message for our page www.tidy-books.co.uk/childrens-bookcases "Evaluated size of HTML is estimated to be over 125 KB and risks not being fully cached. (Issue marker for this rule is not visible in the current view)" Just wondering what needs to be done about it and what it actually means? Thanks
Technical SEO | | tidybooks0 -
How do you mark a quote HTML wise?
Hi, As far as I know, in the past Italic was used to emphasize (similar use to Bold). Now I've seen people use Italic for quotations. Is that the correct thing to do for an entire paragraph or is it a problem for Google wise? Thanks
Technical SEO | | BeytzNet0 -
Can anyone recommend an SEO friendly Joomla extension to use for SEO on an existing website?
Can anyone recommend an SEO friendly Joomla extension to use for SEO on an existing website? I have downloaded sh404sef but I don't want to change my URL's and make them longer than they are at the moment. Any ideas?
Technical SEO | | Karen_Dauncey0 -
Converting files from .html to .php or editing .htaccess file
Good day all, I have a bunch of files that are .html and I want to add some .php to them. It seems my 2 options are Convert .html to .php and 301 redirect or add this line of code to my .htaccess file and keep all files that are .html as .html AddType application/x-httpd-php .html My gut is that the 2nd way is better so as not alter any SEO rankings, but wanted to see if anybody had any experience with this line of code in their .htaccess file as definitely don't wan to mess up my entire site 🙂 Thanks for any help! John
Technical SEO | | JohnHerrigel0 -
URL restructure and phasing out HTML sitemap
Hi SEOMozzies, Love the Q&A resource and already found lots of useful stuff too! I just started as an in-house SEO at a retailer and my first main challenge is to tidy up the complex URL structures and remove the ugly sub sitemap approach currently used. I already found a number of suggestions but it looks like I am dealing with a number of challenges that I need to resolve in a single release. So here is the current setup: The website is an ecommerce site (department store) with around 30k products. We are using multi select navigation (non Ajax). The main website uses a third party search engine to power the multi select navigation, that search engine has a very ugly URL structure. For example www.domain.tld/browse?location=1001/brand=100/color=575&size=1&various other params, or for multi select URL’s www.domain.tld/browse?location=1001/brand=100,104,506/color=575&size=1 &various other non used URL params. URL’s are easily up to 200 characters long and non-descriptive at all to our users. Many of these type of URL’s are indexed by search engines (we currently have 1.2 million of those URL’s indexed including session id’s and all other nasty URL params) Next to this the site is using a “sub site” that is sort of optimized for SEO, not 100% sure this is cloaking but it smells like it. It has a simplified navigation structure and better URL structure for products. Layout is similair to our main site but all complex HTMLelements like multi select, large top navigations menu's etc are all removed. Many of these links are indexed by search engines and rank higher than links from our main website. The URL structure is www.domain.tld/1/optimized-url .Currently 64.000 of these URL’s are indexed. We have links to this sub site in the footer of every page but a normal customer would never reach this site unless they come from organic search. Once a user lands on one of these pages we try to push him back to the main site as quickly as possible. My planned approach to improve this: 1.) Tidy up the URL structure in the main website (e.g. www.domain.tld/women/dresses and www.domain.tld/diesel-red-skirt-4563749. I plan to use Solution 2 as described in http://www.seomoz.org/blog/building-faceted-navigation-that-doesnt-suck to block multi select URL’s from being indexed and would like to use the URL param “location” as an indicator for search engines to ignore the link. A risk here is that all my currently indexed URL (1.2 million URL’s) will be blocked immediately after I put this live. I cannot redirect those URL’s to the optimized URL’s as the old URL’s should still be accessible. 2.) Remove the links to the sub site (www.domain.tld/1/optimized-url) from the footer and redirect (301) all those URL’s to the newly created SEO friendly product URL’s. URL’s that cannot be matched since there is no similar catalog location in the main website will be redirected (301) to our homepage. I wonder if this is a correct approach and if it would be better to do this in a phased way rather than the currently planned big bang? Any feedback would be highly appreciated, also let me know if things are not clear. Thanks! Chris
Technical SEO | | eCommerceSEO0