0

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

1 Answer 1

0

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.

1
  • 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, 2010 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy