Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
weird problem with mod_rewrite
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Fri Nov 26, 2004 3:00 am    Post subject: weird problem with mod_rewrite Reply with quote

hi all!

i'm trying to redirect requests like http://webmail.domain.com to http://webmail.domain.com/cgi-bin/openwebmail/openwebmail.pl adding the following to /etc/apache2/conf/apache2.conf:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^webmail\.(.+)/?$ http://webmail.$1/cgi-bin/openwebmail/openwebmail.pl
</IfModule>

mod_rewrite is loaded (apache 2.0.52) but it doesn't work at all... even not with trivial rewrite rules...
nothing useful in apache's error log.

thank you in advance
Back to top
View user's profile Send private message
wmgoree
Apprentice
Apprentice


Joined: 08 Aug 2003
Posts: 246
Location: Alexandria, VA

PostPosted: Fri Nov 26, 2004 8:37 am    Post subject: Re: weird problem with mod_rewrite Reply with quote

skunk wrote:

RewriteRule ^webmail\.(.+)/?$ http://webmail.$1/cgi-bin/openwebmail/openwebmail.pl


Hmm.... in general, tell the regex engine everything you know:

RewriteRule ^webmail.domain.com(.*)?$ http://webmail.domain.com/cgi-bin/openwebmail/openwebmail.pl

Unless you want webmail.domain.com/foo to turn into webmail.domain.com/foo/cgi-bin/openwebmail/openwebmail.pl

I can't tell which one you're trying to do.
_________________
vi? *snicker* it doesn't even include a mail reader...
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Fri Nov 26, 2004 9:05 am    Post subject: Reply with quote

Turn on the rewrite logs as well so you can see exactly what it's doing.
Back to top
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Fri Nov 26, 2004 10:48 am    Post subject: Re: weird problem with mod_rewrite Reply with quote

wmgoree wrote:
Hmm.... in general, tell the regex engine everything you know:

RewriteRule ^webmail.domain.com(.*)?$ http://webmail.domain.com/cgi-bin/openwebmail/openwebmail.pl

Unless you want webmail.domain.com/foo to turn into webmail.domain.com/foo/cgi-bin/openwebmail/openwebmail.pl

I can't tell which one you're trying to do.

it should work for every virtual domain so i can't hardcode the domain itself...
and no, webmail.domain.com/foo doesn't need to be redirected, just webmail.domain.com/
fleed wrote:
Turn on the rewrite logs as well so you can see exactly what it's doing.

already tried with log level 9, but the log keeps empty :(
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Fri Nov 26, 2004 11:45 am    Post subject: Reply with quote

Maybe there's something that keeps apache from even getting to your rewrite rules? What else do you have on your config?
Back to top
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Fri Nov 26, 2004 1:13 pm    Post subject: Reply with quote

fleed wrote:
Maybe there's something that keeps apache from even getting to your rewrite rules? What else do you have on your config?

configs are from default installation, the only thing i've changed is uncommenting
Code:
#Include conf/vhosts/dynamic-vhosts.conf

i've tried to apply the rewrite rule to others gentoo servers, but doesn't work neither... :(
Back to top
View user's profile Send private message
Loki|muh
n00b
n00b


Joined: 30 Jan 2003
Posts: 54

PostPosted: Tue Dec 14, 2004 3:55 am    Post subject: Reply with quote

I have the same Problem :(

anything new?
Back to top
View user's profile Send private message
Loki|muh
n00b
n00b


Joined: 30 Jan 2003
Posts: 54

PostPosted: Tue Dec 14, 2004 4:47 am    Post subject: Reply with quote

succeeded finally with RewriteLog and RewriteLogLevel 9

first I got this working:

RewriteEngine on
RewriteRule ^index.htm http://myserver/foobar

HTH
:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum