Configure VirtualHost to Rewrite HTTP://subdomain... to HTTPS://internaldirectory

Posted by David Kaczynski on Server Fault See other posts from Server Fault or by David Kaczynski
Published on 2012-11-11T03:36:07Z Indexed on 2012/11/11 5:04 UTC
Read the original article Hit count: 533

Filed under:
|
|
|

How do I configure Apache to rewrite an http request for a subdomain to an https request for the correct directory?

For example, I have the following VirtualHost configuration:

virtualhost with rewrite

However, this turns http://redmine...us into https://redmine...us/redmine.

Also, changing

RewriteRule ^(.*)$ https://%{HTTP_HOST}/redmine [R] to

RewriteRule ^(.*)$ https://%{HTTP_HOST} [R]

seems to simply redirect the HTTP request to HTTP://...us, which is currently the default /var/www/index.html page.

Any suggestions?

© Server Fault or respective owner

Related posts about apache2

Related posts about virtualhost