httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marat Khalili <...@rqc.ru>
Subject Re: [users@httpd] Apache: Avoiding users to access 'www.foo.com/subdomain1/'
Date Tue, 20 Sep 2016 07:14:19 GMT
There's a way to achieve what you ask with mod_rewrite directives in 
.htaccess, but before trying this, why not point foo.com to a separate 
directory?


--

With Best Regards,
Marat Khalili


On 19/09/16 21:41, thomas Armstrong wrote:
> Hi.
>
> I have an Apache server, which main rootwebdir is 
> '/usr/www/users/foo/' and 'foo.com <http://foo.com>' points there. 
> However, I have some subdomains pointing within their directories:
>
> |subdomain1.foo.com <http://subdomain1.foo.com> ---> 
> /usr/www/users/foo/subdomain1 subdomain2.foo.com 
> <http://subdomain2.foo.com> ---> /usr/www/users/foo/subdomain2 |
>
> This causes me a problem: if anyone types 
> 'www.foo.com/subdomain1/aboutme.html 
> <http://www.foo.com/subdomain1/aboutme.html>', they find 
> 'subdomain1.foo.com/aboutme.html 
> <http://subdomain1.foo.com/aboutme.html>' with another URL, and I'd 
> like to avoid it.
>
> I wondered if there was any way to avoid this (e.g., showing a 404 
> page), by using a directive within the '.htaccess' file of 
> '/usr/www/users/foo/subdomain1'.
>
> Any other solution is welcome. Thank you very much.
>
>


Mime
View raw message