Welcome to WebmasterWorld Guest from 54.146.221.231

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)

New User

5+ Year Member

joined:Sept 27, 2010
posts: 3
votes: 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/5.0.2.2635 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
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
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 ~
Ciredor
3:44 pm on Sept 27, 2010 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 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.

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

New User

5+ Year Member

joined:Sept 27, 2010
posts: 3
votes: 0


thank you jd i will try to check it myself...
2:29 pm on Sept 28, 2010 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 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.

Jim