believeinsharing Posted November 15, 2012 Share Posted November 15, 2012 Hi I am developing one website its in PHP and I am using Eclipse When I click on any page link its shows "www............com/home.php or www............com/blog.php " in address bar where home and blog are my php pages I wanted to hide those php extenstions and would like to see only "www............com/home or www............com/blog" Is it possible and if yes how? Thx in advance for help Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/ Share on other sites More sharing options...
MDCode Posted November 15, 2012 Share Posted November 15, 2012 Look into .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392671 Share on other sites More sharing options...
Manixat Posted November 15, 2012 Share Posted November 15, 2012 (edited) I'm not entirely sure this method is safe but it can be accomplished by having a .htaccess file in your root folder which states the following: RewriteEngine On RewriteCond %{REQUTEST_FILENAME} !-d RewriteCond %{REQUTEST_FILENAME} !-f RewriteCond %{REQUTEST_FILENAME} !-l RewriteRule ^home$ home.php [L,NS] RewriteRule ^blog$ blog.php [L,NS] Again, I am not fully aware of how this works or if it's safe or not, just trying to help out Edited November 15, 2012 by Manixat Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392672 Share on other sites More sharing options...
believeinsharing Posted November 15, 2012 Author Share Posted November 15, 2012 @SocialCloud: thx for ur quick responce I did created .htaccess file and its has following code RewriteEngine on RewriteCond %(REQUEST_FILENAME) !-d RewriteCond %(REQUEST_FILENAME)\.php -f RewriteRule ^(.*)$ $1.php I got this form google.. I have .htaccess file in my page folder where i have all my php pages Directory of my website is: MainFolder thn it has subfolders for Images, Pages, Styles, and Lib Thx Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392674 Share on other sites More sharing options...
MDCode Posted November 15, 2012 Share Posted November 15, 2012 Manixat's example should work. Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392675 Share on other sites More sharing options...
believeinsharing Posted November 15, 2012 Author Share Posted November 15, 2012 @ Manixat: Thx for reply I tried your code bt its not working Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392678 Share on other sites More sharing options...
believeinsharing Posted November 16, 2012 Author Share Posted November 16, 2012 any other option Quote Link to comment https://forums.phpfreaks.com/topic/270738-hide-php-extenstion-from-webpage/#findComment-1392825 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.