You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mark Smits <mp...@gmail.com> on 2010/08/20 12:14:40 UTC

[users@httpd] How to redirect ?

This is going to be a vey very dumb question, so apologies up front. Using
WinAMP with Apache 2.2.11.

I need redirections based on host name. Host1, host2 and host3 all are the
same server

host1 should be staying at host1 at the same port
host2 should be redirected to host2 but different port
host3 should be redirceted to host3 but antoher different port.

So for example

http://<host2>/ <http://%3chost2%3e/>
http://<host2>:6405/InfoViewApp/logon.jsp<http://%3chost2%3e:6405/InfoViewApp/logon.jsp>


I have tried the Redirect directives. I have tried the Rewrite directives. I
have put them in httpd.conf file, in the <Directory /> container and in
.htaccess file. The alias and rewrite mods are loaded.

My last attempt was the very simple RewriteRuel:

RewriteRule http://<host2>/ <http://%3chost2%3e/>
http://<host2>:6405/InfoViewApp/logon.jsp<http://%3chost2%3e:6405/InfoViewApp/logon.jsp>

No matter what I have tried I always end up at http://<host2>. It never gets
redirected

Can someone please give me the exact Rewrite of Redirect directive to use. I
am really stumped as why I can not get this to work.... :-(

Thanks for any reply... and sorry to bother you with something as simple as
this...

Kind regards,
Mark

Re: [users@httpd] How to redirect ?

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 20.08.10 12:14, Mark Smits wrote:
> This is going to be a vey very dumb question, so apologies up front. Using
> WinAMP with Apache 2.2.11.

winamp? Don't you mean wamp?

> I need redirections based on host name. Host1, host2 and host3 all are the
> same server
> 
> host1 should be staying at host1 at the same port
> host2 should be redirected to host2 but different port
> host3 should be redirceted to host3 but antoher different port.

well, just define three virtual hosts where host2 and host3 will have
redirect directive in <VirtualHost> section, or in .htaccess in
DocumentRoot.

> So for example
> 
> http://<host2>/
> http://<host2>:6405/InfoViewApp/logon.jsp

<VirtualHost IP>
ServerName host2
Redirect temp / http://host2:6405/InfoViewApp/logon.jsp
</VirtualHost>

and if those hosts share the same IP, you must have
NameVirtualHost IP

directive in your config.
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I intend to live forever - so far so good. 

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