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
-
Google still listing pages from old domain after 2 change requests
Good Morning I put forward the following question in December 2014 https://moz.com/community/q/google-still-listing-old-domain as pages from our old domain www.fhr-net.co.uk were still indexed in Google. We have submitted two change request in WMT, the most recent was over 6 months ago yet the old pages are still being indexed and we can't see why that would be Any advice would be appreciated
Technical SEO | | Ham19790 -
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 -
How to change the woocommerce product page permalink
Sorry Posting it again. How I can change the product URL structure. Please let me know how to fix woocommerce permalink in wordpress. My current URL is http://www.ayurjeewan.com/product/divya-ashmarihar-kwath and I want to like (only post name) http://www.ayurjeewan.com/divya-ashmarihar-kwath Attached is the screenshot of option available. qa2hZMP.jpg
Technical SEO | | JordanBrown0 -
Redirect Without Passing Old Page Properties
Is there a way to redirect one page to another, e.g. test.com/ to test.com/home, without passing link juice or any other associated properties of the latter to the former?
Technical SEO | | NTGproducts0 -
Will Google index a site with white text? Will it give it bad ratings?
Will google not rank a site bc pretty much all the copy is white (and the background is all white)? Here's the site in question: https://www.dropbox.com/s/6w24f6h5p0zaxhg/Garrison_PLAY.vs2-static.pdf https://www.dropbox.com/sh/fwudppvwy2khpau/t43NozpG3E/Garrison_PLAY.vs3.jpg thanks--if you need me to clarify more let me know TM Humphries LocalSearched.com
Technical SEO | | CloudGuys0 -
I am trying to correct error report of duplicate page content. However I am unable to find in over 100 blogs the page which contains similar content to the page SEOmoz reported as having similar content is my only option to just dlete the blog page?
I am trying to correct duplicate content. However SEOmoz only reports and shows the page of duplicate content. I have 5 years worth of blogs and cannot find the duplicate page. Is my only option to just delete the page to improve my rankings. Brooke
Technical SEO | | wianno1680 -
Top pages give " page not found"
A lot of my top pages point to images in a gallery on my site. When I click on the url under the name of the jpg file I get an error page not found. For instance this link: http://www.fastingfotografie.nl/architectuur-landschap/single-gallery/10162327 Is this a problem? Thanks. Thomas. JkLej.png
Technical SEO | | thomasfasting0 -
Link juice distributed to too many pages. Will noindex,follow fix this?
We have an e-commerce store with around 4000 product pages. Although our domain authority is not very high (we launched our site in February and now have around 30 RD's) we did rank on lots of long tail terms, and generated around 8000 organic visits / month. Two weeks ago we added another 2000 products to our existing catalogue of 2000 products, and since then our organic traffic dropped significantly (more than 50%). My guess is that link juice has been distributed to too many pages, causing rankings to drop on overall. I'm thinking about noindexing 50% of the product pages (the ones not receiving any organic traffic). However, I am not sure if this will lead to more link juice for the remaining 50% of the product pages, or not. So my question is: if I noindex,follow page A, will 100% of the linkjuice go to page B INSTEAD of page A, or will just a part of the link juice flow to page B (after flowing through page A first)? Hope my question is clear 🙂 P.s. We have a Dutch store, so the traffic drop is not a Panda issue 🙂
Technical SEO | | DeptAgency0