Wednesday, 17 February 2016

How to hide .php extension in your website…?

01:56

How    to     hide      .php      extension in    your    website…?
(1)First  of   all  type following code  save  file    as   .htaccess   into   your  website project folder..
Code is given below:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1\.php

and use  following code with above if you want to hide both .html  as well as .php extension


RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1\.php

RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

(2)now   see given example for  to check it..
(a)Now   write code given below   and save   it   for test.php file:
<html>
<body>
<h1>hello world</h1>
<a href="test1">click here </a>
</body>
</html>

(b)Now   write   code    given   below   for    test1.php     file   :
<html>
<body>
<h1>hello world</h1>
<a  href="test">click here </a>
</body>
</html>

Now   run it    on   your  server   instead   of    test.php    if you will just type   test 

For example  instead of  “Localhsot/test.php “   we can use  “Localhost/test”  only to run your php files without extension..

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

PHP Training Mumbai, PHP MySQL Training Mumbai, PHP Course Mumbai, PHP Institute Mumbai

 

© 2013 PHP TRAINING IN MUMBAI BY OM SIR . All rights resevered. Designed by OM SIR

Back To Top