views:

27

answers:

1

I have three files in a folder 'test'

one.php
two.php
print.html

And i have .htaccess file in the same folder

RewriteEngine On
RewriteBase /test/
RewriteRule ^(.+)\.html$ $1\.php [L]

if we take the print.html in browser , there will be error , because of .htaccess file, for there is no 'print.php' page

How can we solve it , by modifing the .htaccess file. So that while taking the print.html, it should display in the browser

A: 

Try this.

RewriteEngine On
RewriteBase /test/
#If the request is for a file that exists already on the server, the "$1\.php" rule isn't served. 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.html$ $1\.php [L]
Shuriken