Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Remove .php, .html,.htm extension from website url.

    • 0
    • 2
    • 2
    • 2
    • 0
    • 0
    • 0
    • 0
    • 1.28k
    Comment on it

    Hello ,

    I am sharing here how you can remove .php extension from Url of your website. here are the following steps:-

    1. Create a .htaccess file in project directory.
    2. Suppose you have to remove the .php extension from a PHP file for example abc.com/test.php to abc.com/test you have to add the following code inside the .htaccess file:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L] 
    1. Now load your website in browser, you will able to load php pages without .php.

    2. If you want to remove .html from html file, you have to replaced last line of the above code as mentioned below :-

    RewriteRule ^([^\.]+)$ $1.html [NC,L]

    Enjoy..

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: