htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Problems with 2 WordPress installs and htpasswd
PostPosted: 28 May 2008 06:12 
Offline

Joined: 28 May 2008 05:54
Posts: 1
Hi,

So this one kinda falls both in rewrite and htpasswd - so I've but it here... If I'm in the wrong spot I'm sorry.

I'm trying to set up two installs of Wordpress in one account, but I'm looking to password protect one using htpasswd (I was using the cPanel built-in "password protect directories" to do this.

Here's the setup:
WordPress Install #1 - this is the all-access install in /public_html/. The .htaccess reads:
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


And WordPress Install #2 - this is the one I'm trying to password protect. It's installed to /public_html/locked/. It's .htaccess reads:
Code:
AuthName "Locked"
AuthUserFile ".passwd"
AuthType Basic
require valid-user

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /locked/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /locked/index.php [L]
</IfModule>
# END WordPress



So here's what's going on:
> If I don't require login (by removing the AuthType and require lines, or by disabling it via cPanel) eveything works perfectly. Each WordPress install handles the re-writes the way I'd expect them to and acts as if the other one doesn't exist (verified by using a different layout on /public_html/locked/).
> If I do require login (Either by re-adding the lines, or enabling via cPanel) everything reverts back to /public_html/. So what was a valid (and working) page at example.com/locked/contact is now accessing data as if it's example.com/contact.

I was under the (Obviously incorrect) impression that the "-f" and "-d" lines were to have Apache ignore the rules when dealing with a valid file or directory - so I'd assumed that the /public_html/ rules would be ignored when browsing a child folder, and Apache would simply use the .htaccess rules from the child instead.

Any idea how I can make this work?


Top
 Profile  
 
 Post subject: Re: Problems with 2 WordPress installs and htpasswd
PostPosted: 07 Jun 2008 00:07 
Offline

Joined: 07 Jun 2008 00:05
Posts: 1
I'm having a similar issue, were you able to find a solution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB