Forum Moderators: coopster

Message Too Old, No Replies

Getting Rid of Extensions in URL

         

d40sithui

1:18 pm on Jun 28, 2007 (gmt 0)

10+ Year Member



Hey guys,
This is probably a stupid question, but does anyone know of a way to get rid of the ".html" or ".php" extension from the URL.

Example URL
www.mysite.com/page1.html

Ideal URL
www.mysite.com/page1

I know if you make a folder like so -- www.mysite.com/page1/
I guess thats one way...however is there a way to get rid of the slash as well?

Habtom

1:34 pm on Jun 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can achieve this by editing your htaccess to modify URLs to a different format.

Check this thread [webmasterworld.com]

Hab

[edited by: Habtom at 1:34 pm (utc) on June 28, 2007]

Patrick Taylor

9:57 am on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my .htaccess file I use:

RewriteRule ^([a-z0-9\-]+)$ /$1.php [L]

So instead of my URLs being /example.php they are /example