i have a problem with this website after i added this piece of code to the .htaccess file

#Rewrite .php to .html 
RewriteEngine on  
RewriteBase /
RewriteCond %{THE_REQUEST} (.*)\.php  
RewriteRule ^(.*)\.php $1.html [R=301,L]

the code was suppose to rewrite all the name of my pages that ends with .php to .html
the problem i have now is that the server doesn't see the file..

i thought it didn't mean wether u change the name of the extension or not..
so can anyone help me out on how i can solve this please

Re: problem with .htaccess and php 80 80
Member Avatar

How about...

RewriteEngine On
RewriteRule ^(.*)\.php$ $1.html [L,R]

This redirects all pages trying to access the .php extension to the html counterpart. So it looks for the physical html file. Is that what you want?

If you're looking for a simple rewrite (not a redirect), just leave off the 'R'.

However, why would you do this? If you want a swanky url, just leave off the extensions.

Be a part of the DaniWeb community

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