Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Search Search
Search for:
Tech Support Guy > > >

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


(!)

Waxbar1's Avatar
Waxbar1 Waxbar1 is offline
Junior Member with 8 posts.
THREAD STARTER
 
Join Date: Aug 2009
Experience: Intermediate
04-Aug-2009, 02:11 PM #1
Solved: How do I remove the .html or .php from page address?
I want the address to show up in the address bar as www.yourdomain.com/superpage not www.yourdomain.com/superpage.html

I'm sure there is a simple command to put into the .htaccess file? Does anyone know this command, or if there isn't one how do I do this?
Waxbar1's Avatar
Waxbar1 Waxbar1 is offline
Junior Member with 8 posts.
THREAD STARTER
 
Join Date: Aug 2009
Experience: Intermediate
04-Aug-2009, 02:22 PM #2
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

Last edited by Waxbar1; 04-Aug-2009 at 02:30 PM..
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


Tags
.htaccess, file extension, html, web address

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑