ultrasound0000 Posted March 10, 2009 Share Posted March 10, 2009 I am in the process of changing all my site files from html to php. How does this affect SEO? Do I need to have 301 redirects for each file or is there a way to do this more efficiently. Im running Windows box so all my redirects are going to be handled on IIS 7. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/ Share on other sites More sharing options...
Daniel0 Posted March 10, 2009 Share Posted March 10, 2009 Assuming you use the same filenames, but with a php extension instead of html, then you can do this using Apache's httpd.conf or .htaccess: RewriteEngine on RewriteRule (.*)\.html$ $1.php [R=301,L] Edit: I should learn to read the entire post before replying. You're using IIS. Anyway, yes, you do need 301 redirects if you don't want to hurt your rankings. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781249 Share on other sites More sharing options...
Maq Posted March 10, 2009 Share Posted March 10, 2009 I am in the process of changing all my site files from html to php. How does this affect SEO? Your pages are viewed by the crawler how you view them. PHP is server side but produces HTML in the end so it should have no effect for SEO. The best way to ensure this is to run your site through the W3 Validator. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781254 Share on other sites More sharing options...
Daniel0 Posted March 10, 2009 Share Posted March 10, 2009 Your pages are viewed by the crawler how you view them. PHP is server side but produces HTML in the end so it should have no effect for SEO. He is moving/renaming the pages. This means the old, index and linked-to page will now result in a 404. That will negatively effect his rankings. At least that's how I interpret his post. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781274 Share on other sites More sharing options...
ultrasound0000 Posted March 10, 2009 Author Share Posted March 10, 2009 @Daniel0 - Yes it's a windows box unfortunately, otherwise I knew about the apache trick as well. And yes you are right, I do believe that since the file extensions will no longer be .html but .php I'll have to figure out a way to redirect the pages. Just like you recommended with apache, with one line of code, but not sure if this is possible on IIS. Otherwise I might have to do a 301 for each page which would totally suck. So this topic remains open to suggestions ... Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781307 Share on other sites More sharing options...
Daniel0 Posted March 10, 2009 Share Posted March 10, 2009 I have no experience with IIS whatsoever, but I found this using a search on Google: http://www.isapirewrite.com/ Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781318 Share on other sites More sharing options...
ultrasound0000 Posted March 10, 2009 Author Share Posted March 10, 2009 Actually found out that you can map html to run php code (or just html code if no php code present) in IIS, so that is solved. However I'm not sure if this is the best approach long term. Is it ok to use .html extensions for a php site, are there any drawbacks? I hope someone has some ideas or suggestions on this. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781410 Share on other sites More sharing options...
Daniel0 Posted March 10, 2009 Share Posted March 10, 2009 That's perfectly okay. Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-781514 Share on other sites More sharing options...
chmpdog Posted April 27, 2009 Share Posted April 27, 2009 On my site I convert .php to .html. the only drawback I have is it's harder to use $_GET tags Quote Link to comment https://forums.phpfreaks.com/topic/148766-solved-changing-all-site-files-from-html-to-php/#findComment-820387 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.