You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Eric Wagar <ew...@yahoo.com> on 2003/05/15 03:03:56 UTC
[users@httpd] Which do I need, mod_rewrite or a redirect?
I have a server that has multiple domains hosted on it. There is only one
active one, and a few that are old/deprecated.
I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com to
instead see www.gooddomain.com. I would like it to be transparent, ie,
there is no page telling the user the page/domain has changed.
I have played with the Redirect directive in a .htaccess, but it still comes
up with the www.baddomain1.com address in the url.
And, I am unsure which mod_rewrite I'd need.
thanks
eric
---------------------------------------------------------------------
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] Which do I need, mod_rewrite or a redirect?
Posted by Zac Stevens <zt...@cryptocracy.com>.
Hi Eric,
On Wed, May 14, 2003 at 06:03:56PM -0700, Eric Wagar wrote:
> I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com to
> instead see www.gooddomain.com. I would like it to be transparent, ie,
> there is no page telling the user the page/domain has changed.
The easiest way to accomplish this is adding the old domains as aliases
using the 'ServerAlias' directive. If that is unsuitable, you will need to
use mod_rewrite. I'm not a rewrite guru, but if you take a look through
the URL rewriting guide you will find plenty of example rules which you can
amend to fit your precise situation:
http://www.engelschall.com/pw/apache/rewriteguide/
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
[users@httpd] HTTP to HTTPS using mod_rewrite
Posted by Beau Hebert <bh...@c-quential.com>.
Hello-
I've been assigned the task of redirecting all incoming http requests to
https. Problem is, I am not an administrator. I've done a little
research, and it seems that this is possible using mod_rewrite. I've
copied the code that I've come up with below, but doesn't seem to be
working. Can anyone confirm if this should/could work?
Thanks much
Beau
<IfModule mod_rewrite.c>
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)
https://%{SERVER_NAME}/$1 [L,R]
</IfModule>
#This code within Virtual Host
RewriteEngine on
RewriteOptions inherit
---------------------------------------------------------------------
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] Which do I need, mod_rewrite or a redirect?
Posted by Sander Holthaus - Orange XL <in...@orangexl.com>.
Sorry, typo
<VirtualHost *:80>
ServerName www.baddomain1.com
ServerAlias *.baddomain1.com *.baddomain2.com *.baddomain3.com
RedirectMatch permanent ^.* http://www.gooddomain.com/
</VirtualHost>
-----Original Message-----
From: Sander Holthaus - Orange XL [mailto:info@orangexl.com]
Sent: donderdag 15 mei 2003 13:57
To: users@httpd.apache.org
Subject: RE: [users@httpd] Which do I need, mod_rewrite or a redirect?
Make a single virtualhost for all the bad domains.
<VirtualHost *:80>
ServerName www.baddomain1.com
ServerAlias *.baddomain1.com *.baddomain2.com *.baddomain3.com
RedirectMatch permanent ^.* http://www.gooddomain.com/ </VirtualHost>
This should take care of it. It will redirect all traffic to the new good
domain.
Kind Regards,
Sander Holthaus
-----Original Message-----
From: Jurgen [mailto:apache@squarehosting.com]
Sent: donderdag 15 mei 2003 5:04
To: users@httpd.apache.org
Subject: Re: [users@httpd] Which do I need, mod_rewrite or a redirect?
Hi,
if you make a correct redirect the location in the browser window will
change to the good domain. Or I am not getting the problem.
Jurgen
On Wed, 14 May 2003 18:03:56 -0700
"Eric Wagar" <ew...@yahoo.com> wrote:
> I have a server that has multiple domains hosted on it. There is only
> one active one, and a few that are old/deprecated.
>
> I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com
> to instead see www.gooddomain.com. I would like it to be transparent,
> ie, there is no page telling the user the page/domain has changed.
>
> I have played with the Redirect directive in a .htaccess, but it still
> comes up with the www.baddomain1.com address in the url.
>
> And, I am unsure which mod_rewrite I'd need.
>
> thanks
> eric
>
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
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] Which do I need, mod_rewrite or a redirect?
Posted by Sander Holthaus - Orange XL <in...@orangexl.com>.
Make a single virtualhost for all the bad domains.
<VirtualHost *:80>
ServerName www.baddomain1.com
ServerAlias *.baddomain1.com *.baddomain2.com *.baddomain3.com
RedirectMatch permanent ^.* http://www.gooddomain.com/
</VirtualHost>
This should take care of it. It will redirect all traffic to the new good
domain.
Kind Regards,
Sander Holthaus
-----Original Message-----
From: Jurgen [mailto:apache@squarehosting.com]
Sent: donderdag 15 mei 2003 5:04
To: users@httpd.apache.org
Subject: Re: [users@httpd] Which do I need, mod_rewrite or a redirect?
Hi,
if you make a correct redirect the location in the browser window will
change to the good domain. Or I am not getting the problem.
Jurgen
On Wed, 14 May 2003 18:03:56 -0700
"Eric Wagar" <ew...@yahoo.com> wrote:
> I have a server that has multiple domains hosted on it. There is only
> one active one, and a few that are old/deprecated.
>
> I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com
> to instead see www.gooddomain.com. I would like it to be transparent,
> ie, there is no page telling the user the page/domain has changed.
>
> I have played with the Redirect directive in a .htaccess, but it still
> comes up with the www.baddomain1.com address in the url.
>
> And, I am unsure which mod_rewrite I'd need.
>
> thanks
> eric
>
>
>
> ---------------------------------------------------------------------
> 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] Which do I need, mod_rewrite or a redirect?
Posted by Jurgen <ap...@squarehosting.com>.
Hi,
if you make a correct redirect the location in the browser window will change to the good domain.
Or I am not getting the problem.
Jurgen
On Wed, 14 May 2003 18:03:56 -0700
"Eric Wagar" <ew...@yahoo.com> wrote:
> I have a server that has multiple domains hosted on it. There is only one
> active one, and a few that are old/deprecated.
>
> I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com to
> instead see www.gooddomain.com. I would like it to be transparent, ie,
> there is no page telling the user the page/domain has changed.
>
> I have played with the Redirect directive in a .htaccess, but it still comes
> up with the www.baddomain1.com address in the url.
>
> And, I am unsure which mod_rewrite I'd need.
>
> thanks
> eric
>
>
>
> ---------------------------------------------------------------------
> 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] Which do I need, mod_rewrite or a redirect?
Posted by Jeff Cohen <su...@gej-it.com>.
Comment out (with #) all your NameVirtualHost * or VirtualHost * lines and
the Vhosts directive except the actual one you want to serve, that will give
you only one Vhost as the first and the last, in this case, only one site
will be presented.
All the best,
Jeff Cohen
Jeff@GEJ-IT.com
Tel. (416) 917-2324
www.GEJ-IT.com
GEJ-IT Networks!
> -----Original Message-----
> From: Eric Wagar [mailto:ewagar@yahoo.com]
> Sent: Wednesday, May 14, 2003 9:04 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Which do I need, mod_rewrite or a redirect?
>
> I have a server that has multiple domains hosted on it. There is only one
> active one, and a few that are old/deprecated.
>
> I'd like anyone that goes to www.baddomain1.com and www.baddomain2.com to
> instead see www.gooddomain.com. I would like it to be transparent, ie,
> there is no page telling the user the page/domain has changed.
>
> I have played with the Redirect directive in a .htaccess, but it still
comes
> up with the www.baddomain1.com address in the url.
>
> And, I am unsure which mod_rewrite I'd need.
>
> thanks
> eric
>
>
>
> ---------------------------------------------------------------------
> 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