ImJustBrndn Posted October 26, 2006 Share Posted October 26, 2006 I'm curious as to how to hide file extensions in the browser's address bar. For examplehttp://www.threadless.com/submithttp://www.threadless.com/submit.phpboth 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 Link to comment https://forums.phpfreaks.com/topic/25115-hide-file-extensions/ Share on other sites More sharing options...
fert Posted October 26, 2006 Share Posted October 26, 2006 this is an Apache thing Quote Link to comment https://forums.phpfreaks.com/topic/25115-hide-file-extensions/#findComment-114549 Share on other sites More sharing options...
php_joe Posted October 26, 2006 Share Posted October 26, 2006 [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 examplehttp://www.threadless.com/submithttp://www.threadless.com/submit.phpboth 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 Link to comment https://forums.phpfreaks.com/topic/25115-hide-file-extensions/#findComment-114872 Share on other sites More sharing options...
wildteen88 Posted October 26, 2006 Share Posted October 26, 2006 [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 examplehttp://www.threadless.com/submithttp://www.threadless.com/submit.phpboth 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.phpAnother 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. Quote Link to comment https://forums.phpfreaks.com/topic/25115-hide-file-extensions/#findComment-114967 Share on other sites More sharing options...
ImJustBrndn Posted October 26, 2006 Author Share Posted October 26, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/25115-hide-file-extensions/#findComment-115101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.