Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to remove ".html" extension after URL

Pleae Help Me...



1:58 pm on Sep 27, 2010 (gmt 0)

5+ Year Member

Hi I am newbie for making webpage... Just only know basic HTML...

I Have question regarding my website I try to search here but unfortunately i did not get an answer or maybe i don't understand. Can anyone give me a code on my .htaccess or give an idea on how to edit my .htaccess?

I try this code
RewriteEngine On
RewriteRule (.*)\.html $1 [R=301,L]


and it gives me this page error

The requested URL /home/gpcdcmba/public_html/index was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ mod_jk/1.2.30 Server at www.mydomain.com Port 80


actually there is already code found in my .htaccess which i change the code above..here is my old code...
# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
order deny,allow
deny from all
AuthName mydomain.com
AuthUserFile /home/mydomain/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/mydomain/public_html/_vti_pvt/service.grp
Options All -Indexes


Guys i really need your help please help me...

~ Regards ~


3:44 pm on Sep 27, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

The best help I can give you is to suggest that you start with the mod_rewrite documentation, because you cannot successfully "guess" correct code. The chances that you can get it right by just "trying different things" is essentially zero.

mod_rewrite cannot change a URL. If you wish to change the URLs, then edit the HTML pages to link to extensionless URLs, and then add mod_rewrite code to "map" client requests for extensionless URLs to the correct files with .html extensions.

Note the distinction between URLs and filepaths -- They are not the same thing!

This thread [webmasterworld.com] in our Apache Forum Library includes example code to accomplish the extensionless URL to file mapping.



5:24 am on Sep 28, 2010 (gmt 0)

5+ Year Member

thank you jd i will try to check it myself...


2:29 pm on Sep 28, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Please feel welcome to post specific questions back here, once you've studied the threads in the Library. They will almost certainly help you get started, but may leave you with a few more questions.


Featured Threads

Hot Threads This Week

Hot Threads This Month