Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a site hosted on a server at /start/.

In the Apache conf file, I redirect all requests for "/" to "/start/" using the simple rule below:

RewriteEngine on
RewriteRule   ^/?$  /start/  [R]

When I access "http://foo.bar/" the browser is redirected to "http://foo.bar/start/" successfully.

But, when I access "https://foo.bar/", the browser is not redirected to /start/ and instead shows the default Apache welcome page.

What do I have to do to handle https request in a special way?

Note: The site can be accessed successfully behind https. Eg: If I directly access "https://foo.bar/start/", I see the expected page.

The full conf file:

LoadModule proxy_module /usr/lib/httpd/modules/mod_proxy.so

RewriteEngine on
RewriteRule   ^/?$  /start/  [R]

ProxyRequests Off
LogLevel warn

Proxy http://127.0.0.1:8083/
  Order deny,allow
  Allow from all
/Proxy

Location /start/
    ProxyPass http://127.0.0.1:8083/
    ProxyPassReverse http://127.0.0.1:8083/
/Location
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I don't think that is the complete config because I don't see the SSL vhost defintion.

If these statements are in the default server config (i.e., not in an explicit vhost) then you need to put RewriteOptions inherit in the SSL vhost definition.

If they are in a specific vhost conifig then you need to (a) move them into the default server config and add RewriteOptions inherit in the SSL vhost definition or (b) copy them into the SSL vhost definition.

share|improve this answer
    
The SSL vhost configuration is in the default file installed by the mod_ssl package on Redhat systems. By adding <pre> RewriteEngine on RewriteOptions inherit </pre> To the bottom of the VirtualHost section in ssl.conf, I got the redirect to work as I wanted it to. Thank you. –  user55785 Sep 30 '10 at 19:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.