0

I need help with converting html with php .

So far My code is

RewriteEngine on 
RewriteRule ([a-z]+).html /$1.php 

This is working fine. but some real html pages have php scripts ,that doesnt run. how to fix this? thanks

1
  • Need more clarification. What do you mean by some real html pages have php scripts and what URLs are not working? Commented May 11, 2015 at 8:54

2 Answers 2

2

You can use AddHandler directive to change the mime type of a file

Add the following line to your htaccess file

AddHandler application/x-httpd-php .html

Now all your html files will work as php.

Sign up to request clarification or add additional context in comments.

Comments

2

Try this:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.