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
-
What do you do with product pages that are no longer used ? Delete/redirect to category/404 etc
We have a store with thousands of active items and thousands of sold items. Each product is unique so only one of each. All products are pinned and pushed online ... and then they sell and we have a product page for a sold item. All products are keyword researched and often can rank well for longtail keywords Would you :- 1. delete the page and let it 404 (we will get thousands) 2. See if the page has a decent PA, incoming links and traffic and if so redirect to a RELEVANT category page ? ~(again there will be thousands) 3. Re use the page for another product - for example a sold ruby ring gets replaces with ta new ruby ring and we use that same page /url for the new item. Gemma
Technical SEO | | acsilver0 -
301 Redirects Showing As 307 Redirects
Hi, Our clients are adamant that they have set up 301 permanent redirects on their websites, but when we check using Screaming Frog and various online HTTP status code checkers they are showing as 307 temporary redirects. Examples;
Technical SEO | | Webpresence
http://www.lifestylelifts.co.uk/home-lifts/
http://www.terrylifts.co.uk/ Again, the client says they are seeing 301 redirects. Why are we seeing 307's? Who is right? Very puzzling, any theories would be very much appreciated 🙂 Thanks in advance. Lee.0 -
Should I redirect desktop users visiting mobile page to desktop version?
So I am redirecting mobile users to mobile version of the page and also have alternate attrubute set up for that: What about the opposite case? When user from desktop computer visits mobile version of the page. Should I redirect him back to desktop version?
Technical SEO | | poiseo1 -
Should I change or redirect this URL?
Happy Friday everyone! I just noticed that one of our Attorney Profile's url's is wrong. We used to have someone named "Dana Fortugno" as our Family Law attorney, but when he left, (over two years ago) we hired "Scott Finelli." The person who setup the site, just changed the information on the page not url. So instead of it saying "http://www.kempruge.com/scott-finelli-jd-llm/;" it says "http://www.kempruge.com/dana-fortugno-jd-llm/." I'm considering taking all the content on the page with the wrong url, copying it to a new page with the correct URL and 301 redirecting (what would now be a blank page) to the new page with the correct URL. Is this the best way to handle this? Also, I don't believe there are many SEO concerns regarding the pages specifically. The profile pages aren't what we rank for in any of our Family Law related keywords. I am worried about having a completely blank page that just 301 redirects as looking bad to google, but not sure if it would? As always, thank you for your time and any assistance you can provide. Ruben
Technical SEO | | KempRugeLawGroup0 -
Redirecting over-optimised pages
Hi One of my clients websites was affected by Penguin and due to no 'bad link' messages, and nothing really obvious from the backlink profile, I put it down to over-optimisation on the site. I noticed a lot of spammy pages and duplicate content, and submitted recommendations to have these fixed. They dragged their heels for a while and eventually put in plans for a new site (which was happening anyway), but its taken quite a while and is only just going live in a couple of weeks. My question is, should I redirect the URLs of the previously over-optimised pages? Obviously the new pages are nice and clean and from what I can tell there are no bad links pointing to the URLs, so is this an acceptable practice? Will Google notice this and remove the penalty? Thanks
Technical SEO | | Coolpink0 -
Are building a page using HTML 5 better for seo?
Very general question really, but does anyone know whether Google sees html5 pages as being superior in any way to xhtml or html 4.x pages?
Technical SEO | | jimpannell0 -
Can I use canonical tags to merge property map pages and availability pages to their counterpart overview pages?
I have a property website, for each property are 4-5 tabs each with their own URL, these pages include the overview page which is content rich, and auxilliary pages such as maps, availability, can I use a canonical tag to merge the tabs with very little content to their corresponding overview page which is content rich? I.e. www.mywebsite.co.uk/property-1/overview This page has tabs for map, town info, availability which all have their own url i.e. www.mywebsite.co.uk/property-1/map
Technical SEO | | assertive-media
www.mywebsite.co.uk/property-1/availability
www.mywebsite.co.uk/property-1/towninfo Because these auxilary pages do not contain much content can I place a canonical tag in them pointing back to the content rich overview page at www.mywebsite.co.uk/property-1/overview?0 -
How will a domain change affect my rankings?
My company will undergo a domain change in the next few months. Other than implementing 301 redirects, what else can I do to help the search engines realize the site has moved? What kind of impact on rankings can I expect to see? Thanks in advance!
Technical SEO | | raylau0