cmgmyr Posted March 22, 2007 Share Posted March 22, 2007 Ok, i've searched for a little while...I just need to change test.php to test.html Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/ Share on other sites More sharing options...
cmgmyr Posted March 24, 2007 Author Share Posted March 24, 2007 *bump* anyone? Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/#findComment-214293 Share on other sites More sharing options...
wildteen88 Posted March 24, 2007 Share Posted March 24, 2007 If its just test.php to test.html then do this: RewriteRule ^test.html$ test.php So now when type in say http://mysite.com/test.html Apache will call test.php Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/#findComment-214315 Share on other sites More sharing options...
cmgmyr Posted March 24, 2007 Author Share Posted March 24, 2007 can i use 1 rule for the whole site? or would I have to make a new rule for each page? Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/#findComment-214324 Share on other sites More sharing options...
wildteen88 Posted March 24, 2007 Share Posted March 24, 2007 NO you can use it for the whole site. However you will want to use a bit of regex. If all your files on contain characters from a-z then use this: RewriteRule ^([A-Za-z]+).html$ $1.php If you use file1.html then it will call file1.php if you use somethingelse.html it will call somethingelse.php Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/#findComment-214484 Share on other sites More sharing options...
cmgmyr Posted March 24, 2007 Author Share Posted March 24, 2007 ok great, thats actually what I meant/wanted. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/43772-solved-change-php-to-html/#findComment-214489 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.