homepage Welcome to WebmasterWorld Guest from 54.196.159.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
How to block access (view, browsing etc.) files of addon domain direct
addon domain files, block access, addon πετρρσϋ
galench




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

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?

 

jdMorgan




msg:3600201
 3:23 am on Mar 14, 2008 (gmt 0)

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

galench




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

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved