How to allow ONLY specific domain to access a directory?
hi.
I want the directory domain.com/community to be avilable ONLY trough the domain domain.community - entering domain.com/community directly will cause 404, but accessing domain.community will result 200 .
THANKS!
-
hi. please don't shoot - i'm a newbie. there is a directory of a domain. i want to set that directory to be viewable only through another domain. How to do that? Thank you! (please correct me FIRST before blocking. thanks.) 0 -
hi. I want the directory domain.com/community to be avilable ONLY trough the domain domain.community - entering domain.com/community directly will cause 404, but accessing domain.community will result 200 . THANKS!
this version was previously posted by mistake - i can't edit it.0 -
Your best bet is to use the .htaccess file. Get it to check the host. If the host is domain.com, redirect to /index.php for example. However if the host is community.domain.com, do nothing. :) 0 -
Your best bet is to use the .htaccess file. Get it to check the host. If the host is domain.com, redirect to /index.php for example. However if the host is community.domain.com, do nothing. :)
Can you please tell me EXACTLY what write, so I can do "copy-paste"? To my best understanding; you mean the .htaccess that in the domain.com/Directory.0 -
there is a directory of a domain. i want to set that directory to be viewable only through another domain.
Hello, Could you provide a specific example (using fake domain names) of the preferred behavior? Thank you.0 -
Hello, Could you provide a specific example (using fake domain names) of the preferred behavior? Thank you.
but i already did... domain.com has a hosting package. 2nd domain has his own directory at the same hosting package at domain.com/example . I want: to block direct access to domain.com/example with 404 error allowing access only to fakedomain.con, points to that exact same directory, with 200 o.k0 -
Hello, You can forbid the access to specific directory by putting below in htaccess: Options -Indexes You can also redirect 403 error page to your custom error page by putting below in htaccess: ErrorDocument 403 /errors/forbid.html 0 -
Hello, You can forbid the access to specific directory by putting below in htaccess: Options -Indexes You can also redirect 403 error page to your custom error page by putting below in htaccess: ErrorDocument 403 /errors/forbid.html
Will A domain be able to access it? or will it be forbidden for ALL?0 -
To my best understanding: only "public_html" & it's subdirectories are visable to search engines - isn't moving "directory" to the root, out of "public_html"; will make my 2nd site invisible to search bots??
No, that is not accurate. The document root is configured in the Apache configuration file, so Apache knows where to look for the content associated with the domain name. Thank you.0 -
No, that is not accurate. The document root is configured in the Apache configuration file, so Apache knows where to look for the content associated with the domain name. Thank you.
Thanks, it works great. case closed.0 -
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
13 comments