I am using the following code in .y .htaccess file but it is not working

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [nc]
</IfModule>

Please help me
thanks

I'm not very experienced with .htaccess files, but there is something I found after a little Googling that's simpler than your method. I think it assumes that PHP is set up as an Apache module (which is often the case). You could try this:

<FilesMatch "\.(htm|html)$">
 SetHandler application/x-httpd-php
</FilesMatch>

Just put the file extensions in that pipe-separated list and give it a shot. I use this 'FilesMatch' directive to apply gzipping to my css and js files on one of my websites and it works a treat.

Here's the site I referenced for this solution; it seems informative: http://corz.org/serv/tricks/htaccess.php

Thanks dear .........i'll let you know after implementing it.........thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.