Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to block access (view, browsing etc.) files of addon domain direct

addon domain files, block access, addon πετρρσϋ

   
8:54 pm on Mar 13, 2008 (gmt 0)

5+ Year Member



I added my domain2 (through addon) to main hosting account in to folder site2!
So now anybody can see this folder content from my domain2 and my main domain1 too (http://www.domain1.com/site2/).
How to block access for viewing those files under main domain1 and allow to see those files only for domain2 (that added through addon).
It`s possible to do through htacces file?
3:23 am on Mar 14, 2008 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yes, it's possible. See Apache mod_rewrite, RewriteRule directive.

Try a search for previous threads, as well as checking our Forum charter. Our Library may be of interest to you as well.

Jim

12:24 pm on Mar 16, 2008 (gmt 0)

5+ Year Member



jdMorgan! I founded yours instructions here [webmasterworld.com...]

But i try to add code for my addon domain, and nothings happening:


RewriteCond %{HTTP_HOST} ^(www\.)?addon_domain\.com
RewriteRule .* - [L]

There is my .htaccess code:


RewriteEngine on
Options -Indexes

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ http://www.mysite.net/site/ [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^index.htm$ http://www.mysite.net/site/ [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^index.html$ http://www.mysite.net/site/ [R=301,L]

What`s can be a problem in?