Jump to content


Photo

Removing the .php extension


  • Please log in to reply
2 replies to this topic

#1 darthomir

darthomir
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationMontreal, QC Canada

Posted 28 February 2006 - 09:22 PM

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!

#2 dig412

dig412
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 February 2006 - 09:49 PM

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.

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 March 2006 - 01:30 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users