httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea" <softw...@polin.it>
Subject Re: [users@httpd] URL redirection using apache's mod_rewrite
Date Mon, 10 Mar 2003 09:58:30 GMT
Hi,
when using a rule under your .htaccess you need to remove the beginning
slash.

So to make a simple internal redirection you can use:

RewriteEngine On
RewriteRule ^page1\.html$ page2.html

I added a \. because with regular expression . means "every character",
so it needs to be escaped.
Also If you write ^page1.html
it means that it will matche
page11html
page1.html
page1.htmlfooo
because you didn't specified $ which means "end of line"


Also I removed the slash from page2.html because it's not necessary unless
you want to make an absolute path.

About logs I used these lines inside a virtualhost block:

RewriteLogLevel 9
RewriteLog "c:\rewrite.c"


Hope it helps,
~Andrew

----- Original Message -----
From: "anoop prasanna" <anoopp@vit.ac.in>
To: <users@httpd.apache.org>
Sent: Monday, March 10, 2003 16:29
Subject: [users@httpd] URL redirection using apache's mod_rewrite


> Hi everyone, i've trying to do some URL redirection with apache but
> for some reason it just doesnt work.  I'm using a per-directory
> configuration, i.e the .htaccess file and i even tried simple
> redirections like
>
> RewriteRule ^/page1.html /page2.html
>
> but it doesn't work. I've been thru the entire apache manual for
> mod_rewrite but i've still been unsuccessful. Is there a much more
> deeper thing that i'm missing? probably some configuration elsewhere.
> Also where do you give the RewriteLog Directives? In both the
> .htaccess and httpd.conf file it gives an error.  Please help me out..
> Cheers
> Anoop
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message