JustinK101 Posted September 12, 2007 Share Posted September 12, 2007 I know this inst exactly php related, but sortof. LOL I have seen a lot of sites recently that hide the .php extension, for example they might have a url of: http://www.mydomain.com/page1 How are they doing this? I dont think page1 is a folder, I think it is acutally a php file named page1.php but they can hide the extension. I think diggg.com does this. How is this done? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/ Share on other sites More sharing options...
redarrow Posted September 12, 2007 Share Posted September 12, 2007 http://www.sitepoint.com/article/guide-url-rewriting Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346698 Share on other sites More sharing options...
JustinK101 Posted September 12, 2007 Author Share Posted September 12, 2007 Umm do you really have to modify your apache config file and add a rule every time your create a new script with different parameters? That is awful. Am I misssing something? Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346708 Share on other sites More sharing options...
Azu Posted September 12, 2007 Share Posted September 12, 2007 Just name the file "page1" and set your server to open it as PHP. Then you don't need any rewriting. Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346710 Share on other sites More sharing options...
JustinK101 Posted September 12, 2007 Author Share Posted September 12, 2007 So you can exclude extensions? How do you define that in the mime types in apache that no extension is a php file to be parsed by PHP? Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346711 Share on other sites More sharing options...
Azu Posted September 12, 2007 Share Posted September 12, 2007 I think you just set it as the index file, so it uses "page1" instead of "index.php". Or you could just make a folder named "page1" and put an "index.php" in it. This way it will work on all webservers without having to change any configuration, and best of all the functionality will work exactly the same. =) Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346714 Share on other sites More sharing options...
JustinK101 Posted September 12, 2007 Author Share Posted September 12, 2007 yeah but you dont want to have a folder for each file, especially with a big project with say 100+ php files. Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346738 Share on other sites More sharing options...
Azu Posted September 12, 2007 Share Posted September 12, 2007 Why not? Quote Link to comment https://forums.phpfreaks.com/topic/68973-hide-php-extension-like-digg-does/#findComment-346751 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.