Jump to content

Archived

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

ImJustBrndn

Hide File Extensions

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Thanks a lot guys you were all helpful I thought this was a php issue, but it's an apache issue. I used wildteen's approach via the .htaccess file. Thanks again.

Brandon

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.