You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by R'twick Niceorgaw <pu...@utkalika.net> on 2003/01/09 23:38:10 UTC

[users@httpd] mod_rewrite question

Hi all,
pardon me for this silly question but i'm  new to apache  and my boss wants
to figure out this quickly.

My problem is , we have few domains but want all of them to be redirected to
one domain like
if a user goes to http://www.domain1.com he sees http://www.domain1.net or
http://www.domain1.com/xyz  goes to https://www.domain1.net/xyz
samething for https also.
I tried to do it with mod_rewrite but couldn't get anything usefull after
reading the documents.

Can someone help me with this?

Thanks in advance
Regards
R'twick





---------------------------------------------------------------------
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 Zac Stevens <zt...@cryptocracy.com>.
Hi R'twick,

On Thu, Jan 09, 2003 at 05:38:10PM -0500, R'twick Niceorgaw wrote:
> if a user goes to http://www.domain1.com he sees http://www.domain1.net or
> http://www.domain1.com/xyz  goes to https://www.domain1.net/xyz
> samething for https also.
> I tried to do it with mod_rewrite but couldn't get anything usefull after
> reading the documents.

You'll need to list the additional hostnames in the ServerAlias directive
(I presume you've already done this) then a couple of rewrite rules as you
suspected.  Take a look at

http://www.engelschall.com/pw/apache/rewriteguide/#ToC5

Cheers,


Zac

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

Posted by R'twick Niceorgaw <pu...@utkalika.net>.
Thanks a lot.
 I got it working using Redirect directive.

R'twick
----- Original Message -----
From: "R'twick Niceorgaw" <pu...@utkalika.net>
To: <us...@httpd.apache.org>
Sent: Thursday, January 09, 2003 5:54 PM
Subject: Re: [users@httpd] mod_rewrite question


> Thanks Rich,
> I tried the ServerAlias directive like the one below but couldn't get it
to
> work
>
> <VirtualHost xxx.xxx.xxx.xxx:80>
>         ServerName   www.domain.net
>         ServerAlias  www.domain.org
>         ServerAlias  www.domain.com
>         UseCanonicalName Off
> ..............
> .............
> </VirtualHost>
>
> Regards
> R'twick
> ----- Original Message -----
> From: "Rich Bowen" <rb...@rcbowen.com>
> To: <us...@httpd.apache.org>
> Sent: Thursday, January 09, 2003 5:44 PM
> Subject: Re: [users@httpd] mod_rewrite question
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Thu, 9 Jan 2003, R'twick Niceorgaw wrote:
> >
> > > Hi all,
> > > pardon me for this silly question but i'm  new to apache  and my boss
> wants
> > > to figure out this quickly.
> > >
> > > My problem is , we have few domains but want all of them to be
> redirected to
> > > one domain like
> > > if a user goes to http://www.domain1.com he sees
http://www.domain1.net
> or
> > > http://www.domain1.com/xyz  goes to https://www.domain1.net/xyz
> > > samething for https also.
> > > I tried to do it with mod_rewrite but couldn't get anything usefull
> after
> > > reading the documents.
> >
> > ServerAlias is the directive that you're looking for - lets you list
> > alternate names for the same site. No redirection or rewriting is needed
> > unless you really want to.
> >
> > If you really feel that you must redirect, then a simple Redirect is all
> > that is necessary:
> >
> > Redirect / http://other.name.net/
> >
> > Path information is preserved, so /something would go to
> > http://other.name.net/something
> >
> > - --
> > Rich Bowen - rbowen@rcbowen.com
> > http://kenya.rcbowen.com/
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.1 (GNU/Linux)
> > Comment: Made with pgp4pine 1.75-6
> >
> > iD8DBQE+HftfXP03+sx4yJMRApISAJ9H4sMJLGksnzD23jrJdiUrKrRwgwCgxGI4
> > ISd5oXvhkSs7RZAhWm2aMkQ=
> > =VNmP
> > -----END PGP SIGNATURE-----
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
>
>
>
> ---------------------------------------------------------------------
> 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
>



---------------------------------------------------------------------
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 R'twick Niceorgaw <pu...@utkalika.net>.
Thanks Rich,
I tried the ServerAlias directive like the one below but couldn't get it to
work

<VirtualHost xxx.xxx.xxx.xxx:80>
        ServerName   www.domain.net
        ServerAlias  www.domain.org
        ServerAlias  www.domain.com
        UseCanonicalName Off
..............
.............
</VirtualHost>

Regards
R'twick
----- Original Message -----
From: "Rich Bowen" <rb...@rcbowen.com>
To: <us...@httpd.apache.org>
Sent: Thursday, January 09, 2003 5:44 PM
Subject: Re: [users@httpd] mod_rewrite question


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 9 Jan 2003, R'twick Niceorgaw wrote:
>
> > Hi all,
> > pardon me for this silly question but i'm  new to apache  and my boss
wants
> > to figure out this quickly.
> >
> > My problem is , we have few domains but want all of them to be
redirected to
> > one domain like
> > if a user goes to http://www.domain1.com he sees http://www.domain1.net
or
> > http://www.domain1.com/xyz  goes to https://www.domain1.net/xyz
> > samething for https also.
> > I tried to do it with mod_rewrite but couldn't get anything usefull
after
> > reading the documents.
>
> ServerAlias is the directive that you're looking for - lets you list
> alternate names for the same site. No redirection or rewriting is needed
> unless you really want to.
>
> If you really feel that you must redirect, then a simple Redirect is all
> that is necessary:
>
> Redirect / http://other.name.net/
>
> Path information is preserved, so /something would go to
> http://other.name.net/something
>
> - --
> Rich Bowen - rbowen@rcbowen.com
> http://kenya.rcbowen.com/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: Made with pgp4pine 1.75-6
>
> iD8DBQE+HftfXP03+sx4yJMRApISAJ9H4sMJLGksnzD23jrJdiUrKrRwgwCgxGI4
> ISd5oXvhkSs7RZAhWm2aMkQ=
> =VNmP
> -----END PGP SIGNATURE-----
>
>
>
> ---------------------------------------------------------------------
> 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
>



---------------------------------------------------------------------
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 Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 9 Jan 2003, R'twick Niceorgaw wrote:

> Hi all,
> pardon me for this silly question but i'm  new to apache  and my boss wants
> to figure out this quickly.
>
> My problem is , we have few domains but want all of them to be redirected to
> one domain like
> if a user goes to http://www.domain1.com he sees http://www.domain1.net or
> http://www.domain1.com/xyz  goes to https://www.domain1.net/xyz
> samething for https also.
> I tried to do it with mod_rewrite but couldn't get anything usefull after
> reading the documents.

ServerAlias is the directive that you're looking for - lets you list
alternate names for the same site. No redirection or rewriting is needed
unless you really want to.

If you really feel that you must redirect, then a simple Redirect is all
that is necessary:

Redirect / http://other.name.net/

Path information is preserved, so /something would go to
http://other.name.net/something

- -- 
Rich Bowen - rbowen@rcbowen.com
http://kenya.rcbowen.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+HftfXP03+sx4yJMRApISAJ9H4sMJLGksnzD23jrJdiUrKrRwgwCgxGI4
ISd5oXvhkSs7RZAhWm2aMkQ=
=VNmP
-----END PGP SIGNATURE-----



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