0

I've created a directory in site root and used .htaccess/passwd files to build authentication. When navigating to that secure directory on front end I'm getting the EE 404 page template. Any ideas how to accomplish?

Here's my .htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

1 Answer 1

0

Are you sure you set everything up correctly? Do you use the default EE rewrites? Because the default rules check first to see if a requested URI is an actual file or folder first, and if it is, those rules prevent Apache from routing the request through index.php, and EE entirely. Then the file/folder is served by Apache directly. Please provide your EE .ht access rules, the folder you want protected's .htaccess, and your folder path.

Again, make sure you're using the default htaccess rules provided by EllisLabs. Would link out to it but on mobile right now. Google "EE htaccess" or "EE remove index.php" to find it quickly.

1
  • Added my .htaccess code. Standard .htaccess code provided in EE docs. The directory I want secure is in root and it's called "secure"
    – frshjb373
    Apr 22, 2016 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.