Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
March 15, 2010, 06:45:01 AM

Pages: [1]   Go Down
  Print  
Author Topic: password-protect an add-on domain's folder  (Read 794 times)
lunarguin
Spacescooter Operator
*****
Offline Offline

Posts: 32


« on: December 08, 2008, 02:16:39 PM »

If I use CPanel > Security > Password Protect Directories to make an addon domain's directory private, I begin to get Page Not Found errors. Back when the sites were on the regular Business plan, this did not happen to the password-protected folder, which serves as a testing site and contains a Zen Cart install at the "root" level.

I'm unsure how to proceed. Any suggestions?

Could it be something to do with my primary domain's .htaccess file? If so, here is that code:
Code:
# AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
# AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
## Add these to your .htaccess file so that only one way to your site exists,
## either http://yoursite.com and http://www.yoursite.com ... the following
## adds the www if it's missing
## or deletes the www if present AND www is in RewriteCond but not Rewrite Rule

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.myprimarydomain.com$ [NC]
RewriteRule ^(.*)$ http://myprimarydomain.com/$1 [R=301,L]

## the following makes sure the correct mime type is sent for the .htc file

AddType text/x-component .htc

ErrorDocument 400 /index.php?main_page=pagenotfound
ErrorDocument 401 /index.php?main_page=pagenotfound
ErrorDocument 403 /index.php?main_page=pagenotfound
ErrorDocument 404 /index.php?main_page=pagenotfound
ErrorDocument 500 /index.php?main_page=pagenotfound

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]



FWIW, here is the code in the myaddondomain directory's .htaccess file that was created via the Cpanel action:
Code:
AuthType Basic
AuthName "Test Site"
AuthUserFile "/home/portf10/.htpasswds/public_html/myaddondomain/passwd"
require valid-user
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1311



« Reply #1 on: December 08, 2008, 11:10:33 PM »

Hi Lunarguin,

Rules in .htaccess files above the script folder also get applied by Apache so indeed they can affect the setup of the addon domain. Did you try renaming .htaccess of the primary domain to see, if this will change the behaviour you notice.
Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to: