httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Thyssen" <jul...@gmail.com>
Subject Re: [users@httpd] Mod Rewrite assistance sought (hoped for :-)
Date Tue, 17 Jul 2007 19:51:38 GMT
On 7/17/07, Robert Granvin <Robert.Granvin@metrostate.edu> wrote:
> Unfortunately, no (on the content root).  Basically, the "secure" (https)
> portion is a shared subdomain, hence the directory approach.
>
> Think of the structure this way:
>
> /var/www/site1
> /var/www/site2
> /var/www/siten
>  ....
>
> /var/www/secure/
>
>  \\ robert.granvin@metrostate.edu                       Metro State
> University ->site1
> /var/www/secure/ ->site2
> /var/www/secure/ ->siten
> ...
>
> Where the "secure" subdomain has symbolic links to the content root
> of each web site (site1, site2... siten).
>
> Therefore, each web site has access to a single secure server (low cost),
> but has the problem of URLs no longer being valid.

I think I see what you mean now. I do this
in many places, only not in combination with an SSL host.
You just need to make sure Apache listens to the SSL
(and does not modify it) next to the other host name,
and disregards what comes after the name, so it keeps
the sub-folders in place.

Try and use something like this for the document-roots of each site
(so not in the secure doc-root, but the ones deeper),
for example in .htaccess:

RewriteCond %{HTTP_HOST}  !^foo.site.com(:80)?$
RewriteCond %{HTTP_HOST}  !^secure.site.com?$
RewriteRule ^(.*)         http://foo.site.com/$1 [L,R]

This should make sure both https://secure.site.com
and http://foo.site.com will remain in the location bar
for that particular folder, and don't change,
not even if the folder is 1 below the doc-root
of secure.site.com, like https://secure.site.com/foo.

The only part I'm not sure about is how to make sure
it works with httpS on that 'secondary' name.
You should perhaps also have

RewriteCond %{HTTP_HOST}  !^secure.site.com?$

in the secure doc-root folder itself

I'm pretty sure it can be done.

Good luck. ;-)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message