nginx server redirect

Kevin Castiglione kevincastiglione at gmail.com
Sun Jun 21 01:15:46 MSD 2009


On Fri, Jun 19, 2009 at 11:17 PM, Edho P Arief <edhoprima at gmail.com> wrote:

> On Sat, Jun 20, 2009 at 12:44 PM, Kevin
> Castiglione<kevincastiglione at gmail.com> wrote:
> > hi
> > if any one goes to
> > XXX.aaa.com/bbb
> >
> > i want to do a permanent redirect to
> > aaa.com/bbb
> >
> >
> > any suggestions on how to do this?
> > thank you
> >
>
> server {
>  listen 80;
>  server_name *.aaa.com;
>  rewrite ^.* http://aaa.com$uri;
> }

edho:
thanks for this. im going to be handling multiple domains, so is it possible
to do this rewrite without hardcoding?

  rewrite ^.* http://aaa.com$uri;

for ex somthing like
  rewrite ^.* http://$maindomain$uri;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090620/77d26ed7/attachment.html>


More information about the nginx mailing list