On Thu, May 5, 2011 at 11:41 PM, Ndmigration <[email protected]> wrote:
> www.sc.org should serve site from a folder called "cs"
> www.sc.com should serve site from a folder called "dam"
>
> but I don't want them to be interchangeable like www.sc.org/dam or
> www.sc.com/cs. How to restric this?
>
Are they in a NameVirtualHost or the default site for the IP?
If they are in one named vhosts, you could separate it into two and use
directory/location directives in the vhost config.
You could also make them vhosts now even though they weren't before.
Otherwise, I would suggest mod_rewrite.
Something like this might work (although I did not test it)
> RewriteCond %{HTTP_HOST} !^www\.sc\.com [NC]
> RewriteCond %{HTTP_HOST} !^$
> RewriteRule ^dam/?(.*) - [F]
>
RewriteCond %{HTTP_HOST} !^www\.sc\.org [NC]
> RewriteCond %{HTTP_HOST} !^$
> RewriteRule ^cs/?(.*) - [F]
- Yehuda