ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

htaccess help - removing index.php via exclude breaks htaccess auth on subfolder

February 17, 2008 8:52am

Subscribe [1]
  • #1 / Feb 17, 2008 8:52am

    somwicked

    26 posts

    Any htaccess gurus available? I’ve narrowed the problem down - just have not figured out a way around it yet.

    I’m using the exclude method to remove index.php from URLs. I have excluded a subfolder located under the root of the site.

    RewriteCond $1 !^(subfolder|favicon\.ico|robots\.txt|index\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    In the subfolder referenced above, I have another htaccess file to protect the subfolder from prying eyes - .

    AuthType Basic
    AuthName "subfolder"
    AuthUserFile "/path/to/htpasswd"
    require user username

    With the code in place as is, I am redirected to the EE index page of my site - almost like EE is showing a 404 page.

    If I remove the auth info (specifically the require user line) from the subfolders htaccess file, the directory is shown correctly - without authorization. If I remove the rewrite rules for the removing index.php, the authentication works as expected.

    Do I need to add something else to the subfolder’s htaccess file? If so, what? Could there be something else I’m missing in the main htaccess file?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases