corillo181 Posted January 5, 2008 Share Posted January 5, 2008 i was looking at some one page that i know is made with php but the extension is html. and all the files show html in the browser but they are php in the folders. is this done with mod rewrite? if so how would i do to get all the file in my site and change the php to html thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/ Share on other sites More sharing options...
hitman6003 Posted January 5, 2008 Share Posted January 5, 2008 It can be done two ways (that I know of)...mod_rewrite or by making the .html extension equate to a php script. Just like you have to tell apache (or IIS) that ".php" means to use the php interpreter, you can tell it to use the php interpreter for .html files as well. Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-431133 Share on other sites More sharing options...
corillo181 Posted January 5, 2008 Author Share Posted January 5, 2008 i was looking around and i saw that it can be done with a htaccess file but i think it say i have to put it in every director yin order to work.. wouldn't be the same as making a single one and include it? i try looking at htaccess and tried it out and it works for a few things, but not to change my .php to .html edit: i found something that works is ForceType application/x-httpd-php in a .htaccess file, but now i dont want to change all my files to html :| my whoel site is done with .php extension. Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-431135 Share on other sites More sharing options...
PHPNewbie55 Posted January 5, 2008 Share Posted January 5, 2008 I do the same thing on some of my older sites... I went to change them to PHP but didn't want to change all of the extensions and lose SE Rank.. So I used:: AddHandler application/x-httpd-php .html In my .htaccess and now all of my HTML pages act like PHP pages... But if your page extensions are already PHP it is probably best to leave it alone.. the SE's spider PHP pages pretty well as long as your URLS do not contain too many: ?variable=1&variable=2&variable=3&variable=4 Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-431323 Share on other sites More sharing options...
cooldude832 Posted January 5, 2008 Share Posted January 5, 2008 edit: i found something that works is ForceType application/x-httpd-php in a .htaccess file, but now i dont want to change all my files to html :| my whoel site is done with .php extension. It doesn't matter if its not in the php brackets <?php ?> then the server will just send the output straight to user with a microsecond of extra time. Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-431325 Share on other sites More sharing options...
corillo181 Posted January 9, 2008 Author Share Posted January 9, 2008 so the bototm line is. there is no way to make your php file look as if they are something else? if i had home.php there is no way to make it look like home.htm ? Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-434220 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 Yes you can Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-434268 Share on other sites More sharing options...
cooldude832 Posted January 9, 2008 Share Posted January 9, 2008 well I know 1&1 hosting has a .htaccess or apache mod that says if file isn't found try and find a file with the same name different extension. You can rename all your php files .htm and just set your system to phrase .htm files as that but saying if a user goes to index.htm and then load index.php is a bit more complicated unless its always an extension rewrite Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-434269 Share on other sites More sharing options...
corillo181 Posted January 9, 2008 Author Share Posted January 9, 2008 Yes you can any insight? i heard with .htaccess you can do this somethinghere .php .whateveriwant but only see people saying it never seen a script that do that. Quote Link to comment https://forums.phpfreaks.com/topic/84610-php-html/#findComment-434289 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.