1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: How do I remove the .html or .php from page address?

Discussion in 'Web Design & Development' started by Waxbar1, Aug 4, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. Waxbar1

    Waxbar1 Thread Starter

    Joined:
    Aug 3, 2009
    Messages:
    8
  2. Waxbar1

    Waxbar1 Thread Starter

    Joined:
    Aug 3, 2009
    Messages:
    8
    Found a solution, the code to put into the .htacces file is:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php

    and for multiple file extensions just copy and edit lines 2-4:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)$ $1.html
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/849146