homepage Welcome to WebmasterWorld Guest from 54.198.25.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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...
rhoars



 
Msg#: 4207494 posted 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/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

 

jdMorgan

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



 
Msg#: 4207494 posted 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.

Jim

rhoars



 
Msg#: 4207494 posted 5:24 am on Sep 28, 2010 (gmt 0)

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

jdMorgan

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



 
Msg#: 4207494 posted 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.

Jim

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