Sangha-08 Posted May 10, 2008 Share Posted May 10, 2008 Well , as you may have probably guessed from the title. Is there a way to remove the .php or rename it .html ? but i still want all the functions working .. Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/ Share on other sites More sharing options...
trq Posted May 10, 2008 Share Posted May 10, 2008 You need to add the html extension to the appropriate AddType section of your apache configuration and restart apache. eg; AddType application/x-httpd-php .php .html Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537366 Share on other sites More sharing options...
Sangha-08 Posted May 10, 2008 Author Share Posted May 10, 2008 You need to add the html extension to the appropriate AddType section of your apache configuration and restart apache. eg; AddType application/x-httpd-php .php .html Well, I'm a n00b , i have a website running on cpanel (shared hosting), and is there a way to not have a extention at all , could you please tell me where to do that apache code thing in the cpanel. sorry to bother you, I'm 13 and and a n00bie in php. but thanks for your time. Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537368 Share on other sites More sharing options...
trq Posted May 10, 2008 Share Posted May 10, 2008 I've never used cpanel but it is highly unlikely you have access to the apache configuration files. This should also work within a .htaccess file. Simply create (if one doesn't already exist) a file called .htaccess, place it within your document root and write... AddType application/x-httpd-php .php .html If you want to get rid of the extension all together you would need to use some mod_rewrite trickery. Something like.... Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)$ $1.php [NC] within your .htaccess file will direct addresses such as http://yoursite.com/foo to http://yoursite.com/foo.php and make it look like there is no extension in use. Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537370 Share on other sites More sharing options...
Sangha-08 Posted May 10, 2008 Author Share Posted May 10, 2008 i made the .htaccess file using notepad and with the code below and named it .htaccess , http://www.mywebsite.com/watch.php? & http://www.mywebsite.com/watch? now give me and internal server error. Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)$ $1.php [NC] Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537375 Share on other sites More sharing options...
Sangha-08 Posted May 10, 2008 Author Share Posted May 10, 2008 what should i do ? Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537383 Share on other sites More sharing options...
Zane Posted May 10, 2008 Share Posted May 10, 2008 i made the .htaccess file using notepad and with the code below and named it .htaccess , http://www.mywebsite.com/watch.php? & http://www.mywebsite.com/watch? now give me and internal server error. Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)$ $1.php [NC] I can see what you're trying to do here..and adding .html to the PHP extension list isn't going to help you >http://www.mywebsite.com/watch? >When you go to that address it's looking for a folder called watch not a file.....since there's no extension >so just create an index.php file inside a "watch" folder identical to your watch.php file and you'll be set. just get rid of the .htaccess file Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537405 Share on other sites More sharing options...
Sangha-08 Posted May 10, 2008 Author Share Posted May 10, 2008 Thanks, Its working now. . I love this. Quote Link to comment https://forums.phpfreaks.com/topic/104984-solved-the-extention-quotphpquot/#findComment-537630 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.