Jump to content

Hide File Extensions


ImJustBrndn

Recommended Posts

I'm curious as to how to hide file extensions in the browser's address bar. For example

http://www.threadless.com/submit
http://www.threadless.com/submit.php

both take you to the same file, but if you go to the one without the .php, the .php never shows up. Can someone please tell me how to do this, I've searched and not been able to find it out. Thanks in advance guys, you rock.

Brandon
Link to comment
Share on other sites

[quote author=ImJustBrndn link=topic=112733.msg457739#msg457739 date=1161823879]
I'm curious as to how to hide file extensions in the browser's address bar. For example

http://www.threadless.com/submit
http://www.threadless.com/submit.php

both take you to the same file, but if you go to the one without the .php, the .php never shows up. Can someone please tell me how to do this, I've searched and not been able to find it out. Thanks in advance guys, you rock.

Brandon
[/quote]

For [b]http://www.threadless.com/submit[/b] you just make a folder named "submit" and then name the file index.php instead of "submit.php"

Joe
Link to comment
Share on other sites

[quote author=php_joe link=topic=112733.msg458066#msg458066 date=1161880995]
[quote author=ImJustBrndn link=topic=112733.msg457739#msg457739 date=1161823879]
I'm curious as to how to hide file extensions in the browser's address bar. For example

http://www.threadless.com/submit
http://www.threadless.com/submit.php

both take you to the same file, but if you go to the one without the .php, the .php never shows up. Can someone please tell me how to do this, I've searched and not been able to find it out. Thanks in advance guys, you rock.

Brandon
[/quote]

For [b]http://www.threadless.com/submit[/b] you just make a folder named "submit" and then name the file index.php instead of "submit.php"

Joe
[/quote]
Thats a long winded way of doing it! The best option is to use mod_rewrite!:
[code]RewriteRule ^submit$ submit.php[/code]
Then when ever you go to http://www.threadless.com/submit it'll call submit.php

Another option is to tell Apache to parse extensionless files with PHP instead, which isnt recommended. mod_rewrite is the best way to go about it.
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.