-   Linux - Newbie (
-   -   Redirect Apache (mod_rewrite) from subdomain to https directory (vhost) (

accessthecloud 05-01-2011 04:52 AM

Redirect Apache (mod_rewrite) from subdomain to https directory (vhost)
Hopefully I can find an answer here...

On one of my servers (Centos 5.5), I have been hosting a particularly complex CRM application for one of my clients. Recently they have asked about configuring SSL connections to the CRM. Problem is, SSL is already configured for their main domain but not the sub-domain where the CRM application is accessed.

Rather than purchasing another SSL certificate for their sub-domain (and probably another IP address), would it be possible to setup a redirection from the subdomain to a sub-directory in the SSL directory using mod_rewrite. I have searched online and through the other posts on LinuxQuestions but nothing I have tried works.

For example:

All requests made to would be rewritten/redirected to

Although this looks fairly simple, I have configured (Plesk) multiple virtual hosts that may cause problems.

Thanks in advance for any assistance.

bathory 05-01-2011 08:10 AM


You can use Recirect inside the vhost definition of

<VirtualHost ...>
Redirect /


accessthecloud 05-02-2011 07:07 AM

Thanks, I wonder why I was thinking I needed something more complex?

This is perfect

All times are GMT -5. The time now is 10:32 PM.