Jump to content

Removing the .php extension


darthomir

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!
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.