Will changing page extensions from .html to .php require a redirect?
-
Hi.
We are launching a new website and our .html page extensions will be replaced with a .php page extension.
Example: www.theideapeople.com/web_design.html (current url)
www.theideapeople.com/web_design.php (new url)
Will this require any special treatment to maintain the page SEO ranking? Does it make a difference if you use a .html or .php? Thank you for your help and insight!
Jay
-
You might also consider writing the redirect so that you don't have any extensions (see the SEOmoz URL for an example). That way, whenever you next change technologies, your URL will still stay the same.
-
You're welcome, but please keep in mind that 301 redirects have an inherent loss of PageRank, even though it's quite small - no loss is better than some!
-
Thank you all very much for your help and answers. It is very much appreciated!!
-
Good stuff, thank you for taking the time to help!
-
Nice catch. I agree it should be:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*).html$ $1.php [R=301] -
The better solution is to keep the .html extensions but tell Apache to parse them as though they were php. This is easily done in .htaccess:
AddType application/x-httpd-php .htm .html
I do this with pretty much all of my sites because real .html files are still served fine, and when there is php code it is executed as it would be with a .php file.
-
Will that return a 301 header though? Shouldn't it include "R=301"?
-
If you are doing this to all pages on the site you can knock it out with an htaccess file like this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*).html$ $1.php [NC] -
Hi Jay,
The two will be viewed as entirely different pages. You will need to 301 redirect all .html pages to the .php version.
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
-
How do you fix redirect chains and temporary redirects?
Hi, I have a lot of issues popping up with temporary redirects and redirect chains. I'm still confused as to what exactly redirect chains are and I don't know how to find where the "chains" are or how to fix them. I'm having two issues mainly:1. Temporary RedirectsI have around 100 pages on our www.twowayradiosfor.com website that are being flagged as temporary redirects. All of them have one thing in common: they are review pages (basically, when a customer clicks on the Review button to review a certain product, they are redirected to a review page for that product).URL Example: https://www.twowayradiosfor.com/reviewhelpful.asp?ProductCode=CLS1410-COMBO&ID=44&yes=noI went into our website and set any URL containing the following as noindex:/review.aspWill that fix the issue? If yes, will I also need to do that for any URL containing /reviewhelpful.asp?2. Redirect ChainsIt seems like basically every product page on my website has this issue (over 100 pages). Here's an example of one:https://www.twowayradiosfor.com/Motorola-CLS1110-p/cls1110.htmI don't see any broken links on this page or links that redirect to another page that redirects, etc. What is causing this? Is it something on my header bar that is redirecting (since that header bar appears on every page, maybe that is why this issue shows up on a lot of pages)?I am new to Moz and still trying to figure this stuff out. I really appreciate any help. Thanks, Sawyer
Technical SEO | | AllChargedUp0 -
How to get google to forget my old but still working page and list my new fully optimized page for a keyword?
Hi There! (i am beginner in seo) I have dynamic and static pages on our site. I created a static page for a specific keyword. Fully optimized it, (h1, alt, metas, etc.....maybe too optimized). My problem is that this page is alive for weeks, checked it in GWT and it is in robots.txt, google sees it, and indexed it. BUT whenewer i do a search for that keyword, we still appear with the dynamically created link in the google listings. How could i "redirect" google, if sy make a search for that keyword than shows our optimized page? Is there a tool for that? I cant delete the dynamic page... Any ideas? Thx Andrew
Technical SEO | | Neckermann0 -
Redirect 301 issue. I changed my domain name and Google is killing me.
Hello SEO community: I have this problem, and I don't know exactly what to do. I recently changed my domain from uclasificados.net to uclasificados.com uclasificados.net was a free classified ads for USA in spanish, and was my most affortable site, so I wanted to convert it to .com because I thought it could get more popular with the .com domain. uclasificados.com was before a free classified ads website for Colombia, but was not very popular and had poor traffic so I moved the Colombian content to uclasificados.co. Since I changed my domain from uclasificados.net to uclasificados.com I have lost a lot of ranking, and l my traffic every day is getting lower. I have already checked the 301 redirections and they are working correctly, but even thought I keep getting less traffic and less money. I have also checked with moz tools both sites link juice, and it says that uclasificados.net have better reputation. So I was wondering if I change it back and redirect uclasificados.com to uclasificados.net but I worrie that if I do that, maybe I can make things worse. What do you recommend me?
Technical SEO | | capmartin850 -
I've consolidated other domains to a single one with 301 redirects, yet the new domain authority in MOZ is much less that the redirected ones. Is that right?
I'm trying to increase the domain authority of my main site, so decided to consolidate other sites. One of the other sites has a much higher domain authority, but I don't know why after a 301 redirect, the new site's domain authority hasn't changed on over a month. Does MOZ take account of thes types of things?
Technical SEO | | bytecgroup2 -
Redirecting Several Hundred Pages
As of May 21st 2013 (Penguin 2.0 update) we hit a triple-header and I think we can now officially dubbed the "KING OF GOOGLE PANALTIES"! 😞 -July 2012 - recieved 2 "Unatural Links" email -April 2012 - 20% traffic hit -May 21st 2013 - 35% traffic hit We have/had lots of very low quality links using the same anchor text as well as about 150 very low quality articles and almost 100 categories w/several hundred products that recieved little to no traffic. We have spent the last several weeks cleaning up our link profile and were highly successful in getting most of them removed and have kept detailed reports for our Reconsideration Request for the manual "Unatural Links" penalty. We have also went a step further and have completely redesigned the site that is now much faster/better on-page seo with new, high quality articles and are removing all the low quality articles, categories and products but we are unclear what to do with these. Which brings me to my question. Should we redirect these pages back to the home page or just let them go to 404 error? I have been doing lots of reading on this subject but there doesnt seem to be any good answers. From what I read, neither are good choices and I cannot decide between the lesser of the 2 evil's ..so any help with this would be greatly apreciated! Note:
Technical SEO | | k9byron
-These category and product pages have absolutly no inbound links (link benefit) and in my opinion are only sucking off link juice and generating little to no revenue. There are also no similar categories or products that these could be redirected to. For example, redirecting dog toys to the dog bed category just sounds like it would increase our bounce rate. -Again, the articles also have no link benefit and only a small handful of the articles actually generate any traffic to speak of (several thousand visitors per year) and the rest generate less than 1000 visitors per year. All have high bounce rates and low conversions. It would be nice to keep them live as I think some are okay and could be rewritten/re-purpose over time but maybe in light of our Panda penalty it might be better to just to save them offline, let them go to 404 errors and rewritten/re-purpose them another time? -We did create a very nice 404 page with category navigation and huge search bar so I am leaning more toward this option.
..
Thank in Advance!0 -
Can you 301 redirect a page to an already existing/old page ?
If you delete a page (say a sub department/category page on an ecommerce store) should you 301 redirect its url to the nearest equivalent page still on the site or just delete and forget about it ? Generally should you try and 301 redirect any old pages your deleting if you can find suitable page with similar content to redirect to. Wont G consider it weird if you say a page has moved permenantly to such and such an address if that page/address existed before ? I presume its fine since say in the scenario of consolidating departments on your store you want to redirect the department page your going to delete to the existing pages/department you are consolidating old departments products into ?
Technical SEO | | Dan-Lawrence0 -
HTML url extension
I've read some information about the extension of an url. But i couldn't find a clear answer. What is better for SEO, an extension with html or without? /make-money-online/how-to-make-a-million-dollars-in-1-year/ or /make-money-online/how-to-make-a-million-dollars-in-1-year.html/ Is there a difference between a normal website or a blog?
Technical SEO | | PlusPort0 -
On Page 301 redirect for html pages
For php pages youve got Header( "HTTP/1.1 301 Moved Permanently" );
Technical SEO | | shupester
Header( "Location: http://www.example.com" );
?> Is there anything for html pages? Other then Or is placing this code redirect 301 /old/old.htm http://www.you.com/new.php in the .htaccess the only way to properly 301 redirect html pages? Thanks!0