Jump to content

Recommended Posts

Posted

Hello to all,

 

I have a quite fresh new account on TCH, and while I was playing with .htaccess I got this kind of problem:

 

In the main directory I have an .htaccess file with a redirect like this:

>RewriteCond %{HTTP_HOST} ^andreaplanet\.com
RewriteRule ^(.*)$ http://www.andreaplanet.com/$1 [R=permanent,L]

So every link to andreaplanet.com will be redirected to www.andreaplanet.com. This makes reading statistics more easier.

 

In my subdirectory protectme I have this simple .htaccess file in order to protect it:

>AuthType Basic
AuthName "Authorization Required"
AuthUserFile "/home/...passwd"
require valid-user

 

If I ask for the page http://www.andreaplanet.com/protectme then I get the window asking me the password, everything is ok.

 

The problem is when I try to show up the link http://andreaplanet.com/protectme

Instead of getting the window for asking the password I get an Error 401.

 

Any suggestions on how to fix this problem without removing the redirect/passwd?

Andrea :)

Posted

Have you tried removing the mod_rewrite code? While I wouldn't *think* it shoud cause a problem, its worth a shot, especially since its happening without www, but its working fine *with* www.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...