View Full Version : I want PHP to work on .htm without changing the .htm

07-06-2007, 06:53 AM
I would like to redesign my website from .htm to php. I do not want to loose my page rank or seo. Is there anyway to make php work on .htm. Im also planning on making new pages in .php. I heard about 401 redirect but have no idea how it works. Can this be done? Can someone please help.

07-06-2007, 07:05 AM
Put this into your .htaccess file

AddType application/x-httpd-php .php3 .phtml .php .php4 .html .htm

07-06-2007, 09:14 AM
The above solution is the best

However you can also use apache redirect as

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/url/(.*).html
RewriteRule ^url/(.*) http://sitename/url/$1.php [L]

07-06-2007, 09:17 AM
to redirect page, you use javascript

<script language="javascript">
location.href = "index.php";


07-06-2007, 04:31 PM
What elce do I need in the .htaccess file. I don't have one right now. Do I just make the file and put- AddType application/x-httpd-php .php3 .phtml .php .php4 .html .htm- in the file?

07-06-2007, 04:38 PM
You need to check with your host that they allow mod_rewite and/or they allow you to use your own .htaccess. IMO, I wouldn't use the javascript redirect solution because the search engine spiders can probably see that and they won't like it!