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 remove index.php and password protect directory

June 03, 2014 6:50am

Subscribe [1]
  • #1 / Jun 03, 2014 6:50am

    gojo

    11 posts

    Hi
    I am trying to password protect my codeigniter directory its a test site running on cpanel but since I removed index.php from the urls its stopped the password protection from redirecting canceled attempts.

    AuthName "bobby"
    AuthUserFile "/location to password here/passwd"
    AuthType Basic
    require valid-user
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]

    My htaccess skills are zero has anyone got any ideas.

  • #2 / Jun 03, 2014 7:16am

    gojo

    11 posts

    Oppps its very similar to this
    http://ellislab.com/forums/viewthread/239139/

  • #3 / Jun 04, 2014 12:38am

    gojo

    11 posts

    Hi
    I am trying to password protect my codeigniter directory its a test site running on cpanel but since I removed index.php from the urls its stopped the password protection from redirecting canceled attempts.

    AuthName "bobby"
    AuthUserFile "/location to password here/passwd"
    AuthType Basic
    require valid-user
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]

    My htaccess skills are zero has anyone got any ideas.

    Found an answer this is the htaccess now

    AuthName "bobby"
    AuthUserFile "/location to password here/passwd"
    AuthType Basic
    require valid-user
    RewriteEngine on
    
    RewriteCond %{remote_user} !^$ [nc]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases