You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dariusz Zmokly <gl...@graff.pl> on 2004/11/04 11:36:51 UTC

[users@httpd] mod_rewrite question

Hi!

apache 2.0.xx
gentoo

We've got plenty of clients and want to give them possibility to access Open 
WebMailer with simple address: mail.cilent_domain.
I read about mod_rewrite and wrote:

RewriteEngine on
RewriteCond  %{HTTP_HOST}              ^mail\..*
RewriteRule  ^/$               http://openmailer.our_domain.com

It works but it works through external redirection. How to make it work 
without changing the address mail.client_domain??

best regards,
Dariusz Zmokly

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

Posted by Dariusz Zmokly <gl...@graff.pl>.
On Thursday 04 November 2004 16:26, Joshua Slive wrote:
> Never say "didn't work" on a technical mailing list ;-)  Describe
> *exactly* what happened, and include relevant log messages.
>
> Anyway, this second one is closer, but you probably need to include
> the full filename in there as well.

Yes, you were right!
And the winner is:

RewriteEngine on
RewriteCond  %{HTTP_HOST}              ^mail\..*
RewriteRule   ^(.+)            /www_dir/webmailer_dir/$1

Thank you ;)
Dariusz Zmokly

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

Posted by Joshua Slive <js...@gmail.com>.
On Thu, 4 Nov 2004 15:40:18 +0100, Dariusz Zmokly <gl...@graff.pl> wrote:

> RewriteRule  ^/$               /www_dir/webmailer_dir (the path to webmailer)
> 
> but both didn't work.

Never say "didn't work" on a technical mailing list ;-)  Describe
*exactly* what happened, and include relevant log messages.

Anyway, this second one is closer, but you probably need to include
the full filename in there as well.

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 question

Posted by Dariusz Zmokly <gl...@graff.pl>.
On Thursday 04 November 2004 15:26, Joshua Slive wrote:
> On Thu, 4 Nov 2004 11:36:51 +0100, Dariusz Zmokly <gl...@graff.pl> wrote:
> > RewriteEngine on
> > RewriteCond  %{HTTP_HOST}              ^mail\..*
> > RewriteRule  ^/$               http://openmailer.our_domain.com
> >
> > It works but it works through external redirection. How to make it work
> > without changing the address mail.client_domain??
>
> Use a filesystem path or url-path pointing to the correct location
> rather than an absolute URL.

Target is on the same server. Mayby this IS stupid question but how to "Use a 
filesystem path or url-path"? I tried to modify

RewriteRule  ^/$               http://openmailer.our_domain.com

Instead I wrote:
RewriteRule  ^/$               openmailer.our_domain.com (url without the 
leading http://)

or:
RewriteRule  ^/$               /www_dir/webmailer_dir (the path to webmailer)

but both didn't work.

thank you
Dariusz Zmokly

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

Posted by Joshua Slive <js...@gmail.com>.
On Thu, 4 Nov 2004 11:36:51 +0100, Dariusz Zmokly <gl...@graff.pl> wrote:
> RewriteEngine on
> RewriteCond  %{HTTP_HOST}              ^mail\..*
> RewriteRule  ^/$               http://openmailer.our_domain.com
> 
> It works but it works through external redirection. How to make it work
> without changing the address mail.client_domain??

Use a filesystem path or url-path pointing to the correct location
rather than an absolute URL.

If the target isn't on the same server, you'll need to proxy to it
using the [P] flag and mod_proxy.

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