You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Warron French <wf...@xtria.com> on 2004/11/09 16:13:15 UTC

[users@httpd] URL redirection

Can someone please help me with this issue?

I have these 4 sites:

http://www.hsmts.com
http://www.hsmts.net
http://hsmts.com
http://hsmts.net

the shortened names are ServerAlias(ed) in the httpd.conf file to the longer names.

I HAVE defined unique VirtualHost containers for the websites as appropriate like this==

<VirtualHost .......>
ServerName www.hsmts.com
ServerAlias hsmts.com
DocumentRoot /home/hsmts/public_html
etc....
</VirtualHost>


I created a similar container for the VirtualHost directive for the hsmts.net site and the DocumentRoot IS THE SAME
for both VirtualHost.

What I need to know is how do I get the 4 above URLs to redirect to https://www.hsmts.net


CAN I use are Redirect statement like the following and do I enter that same Redirect statement into both VirtualHost containers?

Redirect http://www.hsmts.com (or .net to do the other VirtualHost) https://www.hsmts.net


To make this more clean without the comment in between==

Redirect http://www.hsmts.com   https://www.hsmts.net


A little tidbit that may be helpful, I do have an index.htm file in the home directory for these sites, remember... all four sites are aliased in pairs and they all 4 share the same home directory.


I just would simply like to know if the syntax is correct and IF SO, do I enter it in both VirtualHost containers?


Thanks in advance,
Warron French
Sr. Network Engineer
Xtria, LLC


---------------------------------------------------------------------
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] URL redirection

Posted by ADev <ap...@anazys.com>.
Hi, I think I can help on this one;)

you could either achieve this in 2 ways:
-redirect with alias
-redirect with mod_rewrite

The easiest would be to use alias, but your redirect directive isn't 
correct.
It needs to point to a file inside the vhost then redirect to a URL:
Redirect index.html https://www.hsmts.net
if the file is index.html of course.
I may have done a mistake like /index.html instead of only index.html 
but this is to try;)
You'll need mod_alias module to be ativated

Hope this help

Xavier

> Can someone please help me with this issue?
>
> I have these 4 sites:
>
> http://www.hsmts.com
> http://www.hsmts.net
> http://hsmts.com
> http://hsmts.net
>
> the shortened names are ServerAlias(ed) in the httpd.conf file to the 
> longer names.
>
> I HAVE defined unique VirtualHost containers for the websites as 
> appropriate like this==
>
> <VirtualHost .......>
> ServerName www.hsmts.com
> ServerAlias hsmts.com
> DocumentRoot /home/hsmts/public_html
> etc....
> </VirtualHost>
>
>
> I created a similar container for the VirtualHost directive for the 
> hsmts.net site and the DocumentRoot IS THE SAME
> for both VirtualHost.
>
> What I need to know is how do I get the 4 above URLs to redirect to 
> https://www.hsmts.net
>
>
> CAN I use are Redirect statement like the following and do I enter 
> that same Redirect statement into both VirtualHost containers?
>
> Redirect http://www.hsmts.com (or .net to do the other VirtualHost) 
> https://www.hsmts.net
>
>
> To make this more clean without the comment in between==
>
> Redirect http://www.hsmts.com   https://www.hsmts.net
>
>
> A little tidbit that may be helpful, I do have an index.htm file in 
> the home directory for these sites, remember... all four sites are 
> aliased in pairs and they all 4 share the same home directory.
>
>
> I just would simply like to know if the syntax is correct and IF SO, 
> do I enter it in both VirtualHost containers?
>
>
> Thanks in advance,
> Warron French
> Sr. Network Engineer
> Xtria, LLC
>
>
> ---------------------------------------------------------------------
> 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] URL redirection

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 9 Nov 2004 10:13:15 -0500, Warron French <wf...@xtria.com> wrote:
> What I need to know is how do I get the 4 above URLs to redirect to https://www.hsmts.net
> 
> CAN I use are Redirect statement like the following and do I enter that same Redirect statement into both VirtualHost containers?

No.  The first argumenr to Redirect is a URL-path, not a complete URL.

But you can do this in two other ways that are described here:
http://httpd.apache.org/docs/misc/FAQ.html#canonical-hostnames

Joshua.

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