WordPress.org

Ready to get started?Download WordPress

Forums

Stop WordPress From Loading In Sub Directories (13 posts)

  1. aran384
    Member
    Posted 6 years ago #

    I think the topic says it all... Basically I want WordPress to stop loading when I load up a certain Sub Directory I.E.

    /Photos/ <-- I have a folder like this that I am trying to one protect using .htaccess and only has pictures in. But the problem is WordPress is stopping this because it is loading the site.

    How can I stop the blog from loading?

  2. jrawle
    Member
    Posted 6 years ago #

    I don't quite understand the question. You have a folder called /Photos and you don't want anyone to have access to it at all? But WordPress is causing the contents of the folder to be revealed? Please can you clarify your problem.

  3. aran384
    Member
    Posted 6 years ago #

    When I protect the folder with htaccess username and password. My wordpress blog starts to appear. But when I don't protect it I see the contents of the folder.

    So I am looking for a way to stop the WordPress blog from showing up when a sub directory is entered.

  4. jrawle
    Member
    Posted 6 years ago #

    When you say your blog appears, do you mean an error page (which is themed with your blog theme)?

  5. aran384
    Member
    Posted 6 years ago #

    No the blog it self appears. Basically the front page.

    The front page was being displayed because a 404 page was not in the theme. I have now added a 404 page and is displayed when trying to access the folder with password protection on it.

  6. justinratwebtek
    Member
    Posted 6 years ago #

    It's either your .htaccess or the Gallery plugin you're using.

  7. aran384
    Member
    Posted 6 years ago #

    I know its my .htaccess, just need a fix for it.

    I am unable to access the folder when it is password protected.

  8. jrawle
    Member
    Posted 6 years ago #

    Please can you explain again what you want to happen.

  9. aran384
    Member
    Posted 6 years ago #

    I want WordPress to not load on Password Protected Folders.

    So basically Don't want WordPress to handle 404s or sub directories that don't exist things like that.

  10. jrawle
    Member
    Posted 6 years ago #

    Could you post your htaccess here? It might just be a matter of changing the order, or adding an extra line to it.

  11. aran384
    Member
    Posted 6 years ago #

    This is my current .htaccess file in my root directory.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^/([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])/$ /$3/$2/$1/ [R=301,L]
    RewriteRule ^/[A-Za-z]/([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])/$ /$4/$3/$2/$1/ [R=301,L]

    </IfModule>

  12. jrawle
    Member
    Posted 6 years ago #

    For your photos folder, you could try adding the following with the other conditional lines:

    RewriteCond %{REQUEST_URL} !=/photos.*

    That should stop WordPress taking control when you attempt to access the photos directory.

  13. Joe Hall
    Member
    Posted 6 years ago #

    I have this same issue and i added the same code to my .htaccess file, but it didn't change a thing....did it work for you aran384?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.