You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matteo Forni <ma...@gmail.com> on 2007/05/15 16:10:35 UTC

[users@httpd] mod_rewrite and domain

Dear Apache Users,
I have a problem: i want to redirect an user that visits
http://www.adomain.com/statistics to
http://IPADDR/awstats/awstats.pl?config=adomain but I don't know how
to.

I tryed with
RewriteRule www\.(.*)/statistics
http://IPADDR/awstats/awstats.pl?config=$1 but i get a 404 error.

Can you help me?

Regards
Matteo

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


Re: [users@httpd] mod_rewrite and domain

Posted by Joshua Slive <jo...@slive.ca>.
On 5/15/07, Matteo Forni <ma...@gmail.com> wrote:
> I tryed but I got a 404...

Hmmm... You don't take a clue, do you? ;-)

Use the RerwiteLog!

Joshua.

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


Re: [users@httpd] mod_rewrite and domain

Posted by Matteo Forni <ma...@gmail.com>.
I tryed but I got a 404...

2007/5/15, Joshua Slive <jo...@slive.ca>:
> On 5/15/07, Matteo Forni <ma...@gmail.com> wrote:
> > Dear Apache Users,
> > I have a problem: i want to redirect an user that visits
> > http://www.adomain.com/statistics to
> > http://IPADDR/awstats/awstats.pl?config=adomain but I don't know how
> > to.
> >
> > I tryed with
> > RewriteRule www\.(.*)/statistics
> > http://IPADDR/awstats/awstats.pl?config=$1 but i get a 404 error.
>
> If you used the RewriteLog to debug, you would see that RerwiteRule
> matches only against the url-path of the request (the part after the
> hostname and port).
>
> You need to use something like
> RerwiteCond %{HTTP_HOST} ^www\.(.*) [NC]
> RewriteRule ^/statistics http://IPADDR/awstats/awstats.pl?config=%1
>
> Joshua.
>
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] mod_rewrite and domain

Posted by Joshua Slive <jo...@slive.ca>.
On 5/15/07, Matteo Forni <ma...@gmail.com> wrote:
> Dear Apache Users,
> I have a problem: i want to redirect an user that visits
> http://www.adomain.com/statistics to
> http://IPADDR/awstats/awstats.pl?config=adomain but I don't know how
> to.
>
> I tryed with
> RewriteRule www\.(.*)/statistics
> http://IPADDR/awstats/awstats.pl?config=$1 but i get a 404 error.

If you used the RewriteLog to debug, you would see that RerwiteRule
matches only against the url-path of the request (the part after the
hostname and port).

You need to use something like
RerwiteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^/statistics http://IPADDR/awstats/awstats.pl?config=%1

Joshua.

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