Alias or RedirectMatch in Apache

Hunter Heinlen dracus at speakeasy.net
Wed May 9 12:38:07 EDT 2007


Eugene Gorelik wrote:

>  RewriteRule  (.*)   https://service.server.somewhere.com$1 
> <https://service.server.somewhere.com$1>

Unfortunately, this produces syntax errors (Invalid command 
'RewriteRule').  I am effectively required to use mod_alias.  I could 
try to convince people in management here that mod_rewrite is not such a 
horrible security risk, but if I don't have to, even better.

Grant M. wrote:

 > I'm not really clear on what it is you are trying to do, but this is
 > how you redirect all non-https to https:

I'm trying to redirect specified services in this format to the tomcat 
instance that handles that particular service:

http://service.server.somewhere.com >  https://service.server.somewhere.com
http://service1.server.somewhere.com > https://service1.server.somewhere.com
http://service2.server.somewhere.com > https://service2.server.somewhere.com
[plus any additional service the developers come up with later, as they 
see fit]

while redirecting all other connections to the base URL (the hostname) 
that do not get https connections:

http://notaservice.server.somewhere.com > http://server.somewhere.com
http://nonservice.server.somewhere.com > http://server.somewhere.com
http://foo.server.somewhere.com > http://server.somewhere.com
http://*.server.somewhere.com > http://server.somewhere.com
http://server.somewhere.com > http://server.somewhere.com

> then you give an example URL that indicates that you want https without port 8080, which would be port 443.

Except that it is redirected to port 8080 elsewhere in the config, and 
port 443 is shut down.  Sorry, completely forgot that yesterday.

Sorry if the first request was not as clear as it could be.  Yesterday 
turned out to be a longer day then expected.  And the responses are 
greatly appreciated.  Many thanks.

Hunter

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Discuss mailing list