• I set up a WordPress site some years ago for my father, who is a university professor.

    One of the things he uses the site for is to make course handouts available to students, but that part has always been done outside the blog structure – there are two directories, one named for each of the two courses he teaches, which are password-protected via htaccess/htpasswd. He gives students the login for these areas at the beginning of the year, and uploads the handouts into these directories as the courses progress. They’ve always been just straight directory listings – there is no index.html or index.php file or anything like that in them, just a bunch of PDFs, and the students click on the PDFs in the directory listing to download them.

    However, lately this has stopped working. Now when anyone tries to go to either of these directories, they get a WordPress 404 page instead of the directory listing of course handouts. I’m not sure if this came about after a WordPress upgrade, or if there was a change to the permalink structure, but basically it looks like WordPress’s .htaccess file is making it rewrite everything, even files that aren’t part of WordPress.

    After looking around through the forum and documentation, I tried the fix listed in the Troubleshooting FAQ for people having similar problems accessing their web host’s stats software (https://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess), modifying the part where it says (stats|failed_auth\.html) to (1010d_notes|2050a_notes) (the names of the two directories in question), but it didn’t work. Maybe the fact that they’re directories rather than pages makes a difference?

    Does anyone know any other way I can stop WordPress from blocking these directories? We’re heading into exam time and the students really need to get access to any course handouts they may have missed!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter spidersilk

    (@spidersilk)

    Thanks – that did the trick!

    It did need a bit of modification for the fact that this site has two different password-protected directories – in case anyone else is in that situation, the change I made was as follows:

    In the part where it says:

    # If requested URL-path does not start with "/library/"
    RewriteCond %{REQUEST_URI} !^/library/

    I changed it to:
    RewriteCond %{REQUEST_URI} !^(/1010d_notes|/2050a_notes)
    where “1010d_notes” and “2050a_notes” are the names of the two directories. So basically, separate them with | and put brackets around them.

    BTW, sorry for the very belated reply – I thought I’d replied quite a while back to say thank you, and only just recently realized that I hadn’t.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making two directory listings visible’ is closed to new replies.