Jump to content

Recommended Posts

My weblog runs on MT 3.2; I tried implementing password protect via CPanel for a sub-blog directory, but I only get error messages when I try to access the sub-blog. As with kristian's situation, the problem seems to be the mod_rewrite conditions in htaccess. If I delete those rewrite rules in the main htaccess, the problem disappears. Deleting those rules in the subdirectory's htaccess does nothing at all.

 

Can anyone suggest a workaround that would allow me to password protect the sub-blog without trashing the mod-rewrite rules for the main weblog?

Link to post
Share on other sites

Anybody? Anybody? Bueller?

 

Found the answer. To force the rewrite rules in my site's main .htaccess to ignore subdirectory "foo", I inserted the following code into the beginning of the main .htaccess, before any other rules. This allowed the standard password-protection procedure to apply to "foo" while leaving the rewrite rules in place for the rest of the site.

 

><IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*foo.*$
RewriteRule . /index.php [L]
</IfModule>

Link to post
Share on other sites

Join the conversation

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

Guest
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...