Jump to content

[SOLVED] Changing all site files from html to php


ultrasound0000

Recommended Posts

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.

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.

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.

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.

@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 ...

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.

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.