Results 1 to 3 of 3

.htaccess and password protection by cpanel

This is a discussion on .htaccess and password protection by cpanel within the General Discussion forums, part of the vBulletin SEO Discussion category; I'm trying to add password protection via my cpanel on my server. I have a .htaccess file that rewrites my ...

  1. #1
    Junior Member Array
    Real Name
    Phil
    Join Date
    May 2008
    Posts
    26
    Liked
    0 times

    .htaccess and password protection by cpanel

    I'm trying to add password protection via my cpanel on my server. I have a .htaccess file that rewrites my public_html root to public_html/links because I have VBaLinks as my main focus of the site.
    This all works perfectly until I try and add the password protection. The cpanel protection adds a .httaccess file under the directory I want to protect which works fine as long as the root rewrite .httaccess file is not active. As soon as it is, the protected folder always give a 404 error.
    Can anyone with better .httaccess skils then me tell me why? The code is posted below with the root .httaccess file first then the password protected directory .httaccess file second.

    Thanks!

    Latest Links on the WEB and Legendary Threads

    Code:
    # Turn on rewrites.
    RewriteEngine on
    
    RewriteRule index\.html index.php [NC,R]
    RewriteRule index\.htm index.php [NC,R]
    
    # Only apply to URLs on this domain
    RewriteCond %{HTTP_HOST} ^(www.)?legendarythreads.net$
    
    # Only apply to URLs that aren't already under folder.
    RewriteCond %{REQUEST_URI} !^/links/
    
    # Don't apply to URLs that go to existing files or folders.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    # Rewrite all those to insert /folder.
    RewriteRule ^(.*)$ /links/$1
    
    # Also redirect the root folder.
    RewriteCond %{HTTP_HOST} ^(www.)?legendarythreads.net$
    RewriteRule ^(/)?$ links/index.php [L]
    Code:
    AuthName "check"
    AuthUserFile "/home/frest/.htpasswds/public_html/ppcheck/passwd"
    AuthType Basic
    require valid-user

  2. #2
    vBSEO Staff Array Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,818
    Liked
    192 times
    You can try this entry from vBSEO's troubleshooting.txt:
    16) I have a problem accessing vB admincp: 404 error is displayed or page is redirected to forums homepage.

    If you have restricted access to your admincp folder using .htaccess (Auth directives), please check
    your apache configuration: having "ErrorDocument 401 401.shtml" directive in httpd.conf requires that
    "401.shtml" file exists. You should create one if it doesn't to solve the problem.
    Oleg Ignatiuk / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Senior Member Array
    Real Name
    Brian
    Join Date
    Apr 2006
    Posts
    6,983
    Liked
    10 times
    also, you probably want to move this.
    AuthUserFile "/home/frest/.htpasswds/public_html/ppcheck/passwd"

    password files should be BELOW public_html so that they aren't accesible by anyonje on the web.... just your webserver itself

Similar Threads

  1. Hotlink Protection Tutorial (Apache Server - .htaccess files)
    By NeutralizeR in forum Member Articles
    Replies: 15
    Last Post: 06-08-2011, 02:25 PM
  2. 404 error with .htaccess protection
    By SaNFooR in forum Pre-Sales Questions
    Replies: 7
    Last Post: 05-16-2007, 06:16 AM
  3. .htaccess for hotlink protection
    By Mert Gökçeimam in forum General Discussion
    Replies: 7
    Last Post: 03-06-2007, 09:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •