You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Coert Waagmeester <lg...@waagmeester.co.za> on 2012/12/18 10:53:24 UTC

[users@httpd] VirtualHost Redirect with an exception

Hello all,

We run a webserver with multiple domains pointing to it.

Only one DNS name is used to serve our website.
All the other DNS names (which exist for purposes other than www) I 
redirect to our main DNS name.

<VirtualHost *:80>
	ServerName mysvcname.net
	ServerAlias www.mysvcname.net
	Redirect / http://www.mywwwname.net
</VirtualHost>

This works perfectly, but on one of the machines where I have this 
Redirect, I am running mailman which used to listen on 
mysvcname.net/mailman which also gets Redirected now wrongly.

Can I add an exception in someway that mysvcname.net gets redirected, 
but mysvcname.net/mailman stays as it should?


Thank you in advance,
Coert Waagmeester

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] VirtualHost Redirect with an exception

Posted by Daniel Gruno <ru...@cord.dk>.
On 12/18/2012 12:18 PM, Coert Waagmeester wrote:
> 
> 
> On 2012/12/18 11:53 AM, Coert Waagmeester wrote:
>> Hello all,
>>
>> We run a webserver with multiple domains pointing to it.
>>
>> Only one DNS name is used to serve our website.
>> All the other DNS names (which exist for purposes other than www) I
>> redirect to our main DNS name.
>>
>> <VirtualHost *:80>
>>      ServerName mysvcname.net
>>      ServerAlias www.mysvcname.net
>>      Redirect / http://www.mywwwname.net
>> </VirtualHost>
>>
>> This works perfectly, but on one of the machines where I have this
>> Redirect, I am running mailman which used to listen on
>> mysvcname.net/mailman which also gets Redirected now wrongly.
>>
>> Can I add an exception in someway that mysvcname.net gets redirected,
>> but mysvcname.net/mailman stays as it should?
>>
>>
>> Thank you in advance,
>> Coert Waagmeester
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
> I have googled some, and everything points to RewriteCond
> Going to try that.
> 
> 
> Thanks,
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

Use RedirectMatch with a negative lookahead instead, for better
performance and clarity:

RedirectMatch ^/(?!mailman)(.*) /$1

With regards,
Daniel.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] VirtualHost Redirect with an exception

Posted by Antonio Moreno <an...@codebusters.es>.
Hi all,

You can review the rules of the reference manual of apache server, 
RedirectMatch is equivalent to |Redirect 
<http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect>|

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectmatch

an introduction to redirect:

http://www.webmasterworld.com/forum92/82.htm

A greeting.


El 18/12/12 12:24, Igor Cicimov escribió:
>
> There is more than one solution. You can use RedirectMatch with 
> negation or RewriteRule with negation or RewriteCond combined with 
> RewriteRule.
>
> On 18/12/2012 10:19 PM, "Coert Waagmeester" <lgroups@waagmeester.co.za 
> <ma...@waagmeester.co.za>> wrote:
>
>
>
>     On 2012/12/18 11:53 AM, Coert Waagmeester wrote:
>
>         Hello all,
>
>         We run a webserver with multiple domains pointing to it.
>
>         Only one DNS name is used to serve our website.
>         All the other DNS names (which exist for purposes other than
>         www) I
>         redirect to our main DNS name.
>
>         <VirtualHost *:80>
>              ServerName mysvcname.net <http://mysvcname.net>
>              ServerAlias www.mysvcname.net <http://www.mysvcname.net>
>              Redirect / http://www.mywwwname.net
>         </VirtualHost>
>
>         This works perfectly, but on one of the machines where I have this
>         Redirect, I am running mailman which used to listen on
>         mysvcname.net/mailman <http://mysvcname.net/mailman> which
>         also gets Redirected now wrongly.
>
>         Can I add an exception in someway that mysvcname.net
>         <http://mysvcname.net> gets redirected,
>         but mysvcname.net/mailman <http://mysvcname.net/mailman> stays
>         as it should?
>
>
>         Thank you in advance,
>         Coert Waagmeester
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>         <ma...@httpd.apache.org>
>         For additional commands, e-mail: users-help@httpd.apache.org
>         <ma...@httpd.apache.org>
>
>
>
>     I have googled some, and everything points to RewriteCond
>     Going to try that.
>
>
>     Thanks,
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>     <ma...@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <ma...@httpd.apache.org>
>


Re: [users@httpd] VirtualHost Redirect with an exception

Posted by Igor Cicimov <ic...@gmail.com>.
There is more than one solution. You can use RedirectMatch with negation or
RewriteRule with negation or RewriteCond combined with RewriteRule.
 On 18/12/2012 10:19 PM, "Coert Waagmeester" <lg...@waagmeester.co.za>
wrote:

>
>
> On 2012/12/18 11:53 AM, Coert Waagmeester wrote:
>
>> Hello all,
>>
>> We run a webserver with multiple domains pointing to it.
>>
>> Only one DNS name is used to serve our website.
>> All the other DNS names (which exist for purposes other than www) I
>> redirect to our main DNS name.
>>
>> <VirtualHost *:80>
>>      ServerName mysvcname.net
>>      ServerAlias www.mysvcname.net
>>      Redirect / http://www.mywwwname.net
>> </VirtualHost>
>>
>> This works perfectly, but on one of the machines where I have this
>> Redirect, I am running mailman which used to listen on
>> mysvcname.net/mailman which also gets Redirected now wrongly.
>>
>> Can I add an exception in someway that mysvcname.net gets redirected,
>> but mysvcname.net/mailman stays as it should?
>>
>>
>> Thank you in advance,
>> Coert Waagmeester
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>>  I have googled some, and everything points to RewriteCond
> Going to try that.
>
>
> Thanks,
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] VirtualHost Redirect with an exception

Posted by Coert Waagmeester <lg...@waagmeester.co.za>.

On 2012/12/18 11:53 AM, Coert Waagmeester wrote:
> Hello all,
>
> We run a webserver with multiple domains pointing to it.
>
> Only one DNS name is used to serve our website.
> All the other DNS names (which exist for purposes other than www) I
> redirect to our main DNS name.
>
> <VirtualHost *:80>
>      ServerName mysvcname.net
>      ServerAlias www.mysvcname.net
>      Redirect / http://www.mywwwname.net
> </VirtualHost>
>
> This works perfectly, but on one of the machines where I have this
> Redirect, I am running mailman which used to listen on
> mysvcname.net/mailman which also gets Redirected now wrongly.
>
> Can I add an exception in someway that mysvcname.net gets redirected,
> but mysvcname.net/mailman stays as it should?
>
>
> Thank you in advance,
> Coert Waagmeester
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
I have googled some, and everything points to RewriteCond
Going to try that.


Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org