Jump to content

Archived

This topic is now archived and is closed to further replies.

darthomir

Removing the .php extension

Recommended Posts

Hi. I'd like to do this on my site: to have an url such as www.google.com/index which would equal to www.google.com/index.php
I mean that I don't want to type the .php extension for my php files. So, if there is no extension, add the .php and load the php file (if possible, do not display the .php). I'm sure its possible with an htaccess file, but not sure how to do it exactly (something with mod_rewrite for sure).

THx!

Share this post


Link to post
Share on other sites
i dont know much about .htaccess, but a blaggers way to do it would be to make a folder with the same name as the file. then put the file in and call it index.php. this will be fine with 1 or 2 file scripts, but anything more complex and its getting a bit tricky.

Share this post


Link to post
Share on other sites
Using mod rewrite should be what you'll need to accomplish this. There is a manual over at apachefreaks.com for using mod rewrite, but I think apachefreaks.com is down due to them upgrading apachfreaks.com

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.