.htaccess code to change the file extension from .php to .html
run method:
[1]. Make a directory structure like this : C:wampwwwjayseoseophphtml
[2]. Make a file inside C:wampwwwjayseoseophphtmlindex.php
[3]. Make a file inside C:wampwwwjayseoseophphtmlindex2.php
[4]. Make a file inside C:wampwwwjayseoseophphtml.htaccess
and copy paste below code in appropriate file name
Now run in url
[A].http://localhost/jay/seo/seophphtml/
Enjoy………..

index.php

<div>
Hi actually this is .php
<br>but
<br>in url looks like .html
</div>
<div><a href=”index2.html”>index2.php</a></div>

index2.php

<div>
Hi actually this is .php
<br>but
<br>in url looks like .html
</div>
<div><a href=”index.html”>index.php</a></div>

.htaccess

RewriteEngine On
RewriteRule ^(.*).html$ http://localhost/jay/seo/seophphtml/$1.php [L]

Share on Facebook