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
-
Why is my inner pages ranking higher than main page?
Hi everyone, for some reason lately i have discovered that Google is ranking my inner pages higher than the main subfolder page. www.domain.com/subfolder --> Target page to be ranked
Technical SEO | | davidboh
www.domain.com/subfolder/aboutus ---> page that is currently ranking Also in the SERP most of the time, it is showing both links in this manner. www.domain.com/subfolder/aboutus
-----------www.domain.com/subfolder Thanks in advance.1 -
Avoid landing page redirects
Avoid landing page redirects for the following chain of redirected URLs. http://domainname.com/ https://domainname.com/ https://www.domainname.com/ Anyone know how to solve this issue the correct way?
Technical SEO | | Sammyh0 -
Does a no-indexed parent page impact its child pages?
If I have a page* in WordPress that is set as private and is no-indexed with Yoast, will that negatively affect the visibility of other pages that are set as children of that first page? *The context is that I want to organize some of the pages on a business's WordPress site into silos/directories. For example, if the business was a home remodeling company, it'd be convenient to keep all the pages about bathrooms, kitchens, additions, basements, etc. bundled together under a "services" parent page (/services/kitchens/, /services/bathrooms/, etc.). The thing is that the child pages will all be directly accessible from the menus, so there doesn't need to be anything on the parent /services/ page itself. Another such parent page/directory/category might be used to keep different photo gallery pages together (/galleries/kitchen-photos/, /galleries/bathroom-photos/, etc.). So again, would it be safe for pages like /services/kitchens/ and /galleries/addition-photos/ if the /services/ and /galleries/ pages (but not /galleries/* or anything like that) are no-indexed? Thanks!
Technical SEO | | BrianAlpert781 -
What changes to subdomains - geo targeting - redirects - to boost our global ranking?
Hi, This is a complex question and I will really appreciate your help as this decision is essential to our business! We are taking a decision about what to do with our website in the terms of redirecting visitors based on their location. At the moment we have the following structure of the website: .com version practically only hosts our blog. The US traffic get presented with .com/us version automatically and the rest of the world gets presented with .com/uk. We are thinking to make .com version global (so no more .com/uk for all countries) in order to improve our ranking globally. At the moment we have good ranks in the UK, but not in the US and other countries. Our company is a global company now and we would like to get more exposure in other countries. We are also thinking to allow the option of geo redirects possible via a small pop-up window - visitors will be able to select their preferred country so next time they will be presented with their default option. To make it short: we would like to boost our domain without dropping ranks in the UK which we are now achieving through .com/uk version. Any ideas, recommendations or experience, I will appreciate! Thanks! Kat
Technical SEO | | Katarina-Borovska0 -
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 -
301 redirect all 404 pages
Hi I would like to have a second opinion on this. I am working on an ecommerce website that they 301 redirect all 404 pages (including the URLs entered incorrectly) to the “All categories page”. Will this have any negative SEO impact?
Technical SEO | | iThinkMedia0 -
Off-page SEO and on-page SEO improvements
I would like to know what off-page SEO and on-page SEO improvements can be made to one of our client websites http://www.nd-center.com Best regards,
Technical SEO | | fkdpl2420