homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

How to remove ".html" extension after URL
Pleae Help Me...

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

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)

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)

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


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

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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved