You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Martin Sarsale <ms...@buenosaires.gov.ar> on 2003/11/11 19:59:18 UTC

[users@httpd] Cancel a previous redirect declaration

Dear all: I've declared a global redirect so it affects every virtualhost. Now, I need to cancel it for a specific VH. Is this possible?

Now, I've solved my problem in an ugly way: 

Global redirect was "/abc", and I want to allow the users to access it directly in the VH

Redirect /abc http://www2.ble.com/abc

<virtualhost *>
	...
	Redirect /abc http://www.ble.com/abc2
	Alias /abc2 /var/www/html/vh/abc
</virtualhost>

Thanks in advance.

-- 
you can find my public PGP/GPG key at http://www.n3rds.com.ar/files/martin_sarsale.key

Re: [users@httpd] Cancel a previous redirect declaration

Posted by Martin Sarsale <ms...@buenosaires.gov.ar>.
> Martin Sarsale wrote:
> > Ok, I'll use that if noone has a better idea :)
> > Anyway, is much clean that my 'redirect and alias' solution :)
> >
> > I guess that RedirectMatch doesn't has the servername on the
> > string it matches, right?
> 
> No. But, mod_rewrite can do everything RedirectMatch can do, and it has
> servername (and much more) available to match on.

I don't know why, but I allways thought that mod_rewrite was not nice with the CPU, but I guess it's the same as RedirectMatch

thanks for everything, robert!


> 
> Regards,
> Robert Andersson
> 
> 
> ---------------------------------------------------------------------
> 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
> 


-- 
you can find my public PGP/GPG key at http://www.n3rds.com.ar/files/martin_sarsale.key

Re: [users@httpd] Cancel a previous redirect declaration

Posted by Robert Andersson <ro...@profundis.nu>.
Martin Sarsale wrote:
> Ok, I'll use that if noone has a better idea :)
> Anyway, is much clean that my 'redirect and alias' solution :)
>
> I guess that RedirectMatch doesn't has the servername on the
> string it matches, right?

No. But, mod_rewrite can do everything RedirectMatch can do, and it has
servername (and much more) available to match on.

Regards,
Robert Andersson


---------------------------------------------------------------------
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] Cancel a previous redirect declaration

Posted by Martin Sarsale <ms...@buenosaires.gov.ar>.
> Martin Sarsale wrote:
> > Dear all: I've declared a global redirect so it affects every virtualhost.
> > Now, I need to cancel it for a specific VH. Is this possible?
> 
> I don't think it is possible to override a global Redirect directive.
> Perhaps this could work:
> 
>     RewriteEngine On
>     RewriteCond %{REQUEST_URI} ^/abc
>     RewriteCond %{SERVER_NAME} !^www\.dontredirectme1\.com$
>     RewriteCond %{SERVER_NAME} !^www\.dontredirectme2\.com$
>     RewriteRule (.*) http://www.ble.com$1
> 

Ok, I'll use that if noone has a better idea :)
Anyway, is much clean that my 'redirect and alias' solution :)

I guess that RedirectMatch doesn't has the servername on the string it matches, right?


-- 
you can find my public PGP/GPG key at http://www.n3rds.com.ar/files/martin_sarsale.key

Re: [users@httpd] Cancel a previous redirect declaration

Posted by Robert Andersson <ro...@profundis.nu>.
Martin Sarsale wrote:
> Dear all: I've declared a global redirect so it affects every virtualhost.
> Now, I need to cancel it for a specific VH. Is this possible?

I don't think it is possible to override a global Redirect directive.
Perhaps this could work:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/abc
    RewriteCond %{SERVER_NAME} !^www\.dontredirectme1\.com$
    RewriteCond %{SERVER_NAME} !^www\.dontredirectme2\.com$
    RewriteRule (.*) http://www.ble.com$1

Regards,
Robert Andersson


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