sw0o0sh Posted June 28, 2010 Share Posted June 28, 2010 It's probably not working either since I'm a newb, lol. But I was going through this tutorial. Basically, my real website files are .php files. I want them to be viewed as .html files, and with an external redirect from .php to .html I was going through this tutorial, but it doesnt seem to work appropriately. RewriteRule ^(.*)\.html$ $1.php [NC] That was basically allowing my php files to be viewable as html files, though the real php version could still be viewed. Then when I added RewriteRule ^(.+)\.php$ http://urlexample.com/$1.html [R=301,NC] It redirects the .php to the .html, but then says the .html doesn't exist. Even though on the previous line it allowed .php to be viewed as .html.. What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/206051-need-to-make-a-php-file-into-an-html-file-than-redirect-not-working/ Share on other sites More sharing options...
cags Posted June 28, 2010 Share Posted June 28, 2010 I'm surprised you don't get a 500 server error since you're essentially creating a loop between php > HTML > php. IMO the best option would be to simply rename all the files to .html, and make Apache parse HTML files as php scripts by using... AddType application/x-httpd-php .html Quote Link to comment https://forums.phpfreaks.com/topic/206051-need-to-make-a-php-file-into-an-html-file-than-redirect-not-working/#findComment-1078157 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.