mod_rewrite

Caporegime
Joined
25 Jul 2003
Posts
40,503
Location
FR+UK
I've been playing about with this for a while now, and I'm getting nowhere nearer, and rather then continue to bug my usual source of help I thought I'd ask here.

I'm basically trying to 'clean' my urls, I've read the apache info on mod_rewrite, and tried to find some decent tutorials but there don't seem to be many real beginner friendly guides around.

Eg: domain/index.html to domain/home/, domain/about.html to domain/about/.
 
Code:
RewriteEngine on
RewriteRule ^/index.html$ http://%{HTTP_HOST}/home/ [R=permanent]
RewriteRule ^/about.html$ http://%{HTTP_HOST}/about/ [R=permanent]
That should do it.
Thanks for that Whitman, is there a rule I can use to "catch all" or should I write a rule for each link?

Doesn't work btw...I get
Not Found
The requested URL /about/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.​
 
Last edited:
Back
Top Bottom