I have a website in html and want to change its coding to .php. Won't there be any problems with maintaining website PR (index.html to index.php)? I'm aware that subpages will lose its PR.
nope. Very simple to use .htaccess to still keep the index.html filename, yet have it execute php inside it (within <? and ?> tags) You just need this to .htaccess (or create a new .htaccess file if one doesnt exist): AddType application/x-httpd-php .html Code (markup): The added beauty of this is that you can leave your site live whilst you change it to php, doing one file at a time as you go along.
Should I make a .htaccess file in public_html directory with just this line, and change all .php files to .html?
I know many php programmers who are using mod_rewrite's to make their sites use .html extensions specifically to help with search engines. Strange to see someone wanting to go the other way. Why are you wanting to do this? Is it just to support php in your pages? If so, you can modify the web server configurationt to treat .html files just like .php and parse them for php code. To answer your search engine question .. any time you change URL's, it will likely cause a temporary drop in traffic from search engines at some point. However, if your site receives enough traffic, it will correct itself. You can use mod_rewrite (via web config or .htaccess) to make the transition smoother as mentioned above. However, if you redirect all .php files to .html files, keep in mind that if you use any third party software like phpBB, vBulletin, etc. those programs use .php extensions and you will break them unless you store them on a different directory or subsite with different mod_rewrite rules. -Zeras
Did anyone try 301 redirections ? I mean leaving old file.html redirecting to new file.php. It is suppose to transfer PR on subpages.
yes, just pop the .htaccess in your public_html folder. This will then treat html pages as php...if no php code is in them, they are treated normally. This avoids any serps hit, will allow files to continue running without any detrimental effects and saves breaking any other software on the server. Simple is always best my friend.