Support » Fixing WordPress » Stop WordPress From Loading In Sub Directories

  • 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?

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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.

    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.

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

    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.

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

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

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

    Please can you explain again what you want to happen.

    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.

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

    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]


    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.

    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?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Stop WordPress From Loading In Sub Directories’ is closed to new replies.