How to hide url extensions? such as .html,.php, etc

how to hide url extensions? such as .html,.php, etc.? i want to have cleaner and easy to remember urls. and since this would also increase my google rank.

any ideas? please?

thanks a lot!

Here: http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html

thanks and im trying to get it work, i have a question though, where do i upload/put my .htaccess file? i have uploaded it in my public_html folder, is that correct?

to whereever you want to enable .htaccess, public_html or any folder that you want.

thank you for your quick reply, heres the code i tried to put in the .htaccess file
i know theres something wrong because its not working. all i wanted is to hide html extensions, ex. www.mysite/services.html to www.mysite/services

RewriteBase /public_html
RewriteEngine on
RewriteRule ^(.*).htm$ $1.html [nc]

thank you for all your patience

RewriteBase /

this is my code now and it aint workin

RewriteBase /
RewriteEngine on
RewriteRule ^(.*).htm$ $1.html [nc]

what possibly could have gone wrong?

whenver i type, www.mysite/services it gives me the index of/ services or it redirects me to http://err.000webhost.com/

please check out this article that might help.

http://support.ongetc.com/index.php?option=com_content&task=view&id=286&Itemid=25&catid=151

i already got the correct code! finally! thanks to rich who sent me the correct code, too bad his username no longer exist, nevertheless im so happy! and all i can say is WOW, works like a charm! rich! your genius!

for those having the same predicament, here’s the code:

RewriteBase /

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

this is what i do
if you have for example thesection.php in the root directory
create a folder named thesection and put thesection.php inside of it and rename the php file to index.php
now if you visit www.yoursite.com/thesection/ your original php file should then be displayed
note that the ending slash MUST be present
this can be done for most url extensions

right! but i prefer doing it in .httaccess file its easier for me (though it took a long time for me to figure out the code) than renaming and creating new folders one by one.

Thakns! I have been looking for this for a while.
But now it works on the 000webhost server, it doesn’t work locally (so if I open the pages locally after editing or something), the new links that don’t point to blabla.html anymore, just blabla, so I was wondering, can I do something similar so my computer will recognize the links?

(btw I don’t know if this makes any diference but I use a mac)

Splatster gave the technic I was going to suggest.

The other idea is to load your additional pages dynamically or in an iframe, then all your people see is your .com address.

you would have to have the same apache.conf file 000webhost has. and I am more than sure they are not going to tell you thier setup for security reasons.