• Here’s what I need to do:
    I have two (for now) directories that I need the mod-rewrite engine to ignore and let act like directories. One is “store” and the other is “protected” – the both contain other files I need to work independently of WordPress.

    Here is my .htaccess file:

    <FilesMatch "\.(?i:pdf)$">
      ForceType application/octet-stream
      Header set Content-Disposition attachment
    </FilesMatch>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(store|protected)(/|$) - [L,NC]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    The line:
    RewriteRule ^(store|protected)(/|$) - [L,NC]
    is something I found with an online search but it doesn’t seem to work… and I am on a shared host so I cannot easily restart Apache.

    Thanks for any help you can provide.

    Here is the website:

    https://www.ganeshhimaltrading.com/
    and
    https://www.ganeshhimaltrading.com/store/

Viewing 3 replies - 1 through 3 (of 3 total)
  • WordPress is setup to allow you to visit your directories without having tomodify htaccess.

    I had the same problem when trying to install Magento, because they recommend you set the directory to 777, but most shared hosts won’t allow you to have a directory open like that. Once I changed the permissions to 775, I had no problem.

    I don’t know if that helps, but that’s how I fixed my issue.

    Thread Starter adentone

    (@adentone)

    Thanks for your reply.

    So you suggest that I set the permission of the directories to 775? They are supposed to be set to 644 and password-protected.

    Does anyone else have a good idea for me to try?

    Both directories exist and contain files – and both are set to 644 and are password-protected.

    Any other suggestions are greatly appreciated.

    Thread Starter adentone

    (@adentone)

    So, upon further investigation, the directories are 755.

    And, WordPress works as expected as long as the directories ARE NOT password protected.

    Any suggestions on getting it to work with password-protected directories?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘htaccess tweaks to ignore non-WP directory’ is closed to new replies.