ShaolinF Posted July 29, 2007 Share Posted July 29, 2007 Hi guys, At the end of my page I want to use .htm instead of .php but then the .php scripts linked to the page won't work. Is there any way around this ? Also, can you define your own types of ending ? Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 http://www.translatum.gr/forum/index.php/topic,824.0.html Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 29, 2007 Share Posted July 29, 2007 Yup there is a way. You can change the settings of your server to be able to parse php within html pages. That is what I remember reading once in a php book. - I'm not exactly sure. Why would you want to change php --> htm anyway? Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 Yup there is a way. You can change the settings of your server to be able to parse php within html pages. That is what I remember reading once in a php book. - I'm not exactly sure. Why would you want to change php --> htm anyway? @TheFilmGod - this may be hard to believe - but the link I posted explains. Quote Link to comment Share on other sites More sharing options...
ShaolinF Posted July 29, 2007 Author Share Posted July 29, 2007 It doesn't work. I keep getting an internal server error when I try to add the .htaccess file. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 29, 2007 Share Posted July 29, 2007 Check your sites error log. Your host may not allow for AddType within .htaccess files. Quote Link to comment Share on other sites More sharing options...
ShaolinF Posted July 29, 2007 Author Share Posted July 29, 2007 [2007-07-29 18:37:38]: error: file has no execute permission: (/home/****/public_html/compose/compose.htm) Now what ? Quote Link to comment Share on other sites More sharing options...
bluefusionxl Posted July 29, 2007 Share Posted July 29, 2007 Here's a better solution I think. The files can still be named .php but appear to the user as .htm. Just open up your .htaccess file and add the following: RewriteEngine On RewriteBase / RewriteRule ^filename.htm$ filename.php Make entries of the RewriteRule on a per file basis on the ones you want to look like they are .htm files. Quote Link to comment Share on other sites More sharing options...
ShaolinF Posted July 29, 2007 Author Share Posted July 29, 2007 That didnt work either. Quote Link to comment Share on other sites More sharing options...
corbin Posted July 29, 2007 Share Posted July 29, 2007 Here's a better solution I think. The files can still be named .php but appear to the user as .htm. Just open up your .htaccess file and add the following: RewriteEngine On RewriteBase / RewriteRule ^filename.htm$ filename.php Make entries of the RewriteRule on a per file basis on the ones you want to look like they are .htm files. A better way to do it would be with: RewriteRule ^(.+)\.htm$ $1.php That would rewrite every .htm file. Anyway, if you can't add a type or use mod rewrite, you're kinda screwed... I'm assuming this is shared hosting? Quote Link to comment 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.