June 29th, 2009 by Lincoln Baxter III

Exposing subfolders under a WordPress installation

So, this is going to be a short-relatively non-technical post, but having just run into the problem of exposing a subdirectory when WordPress is installed into the root directory of a typical DreamHost or GoDaddy style account, I found the need, so here’s the answer if anyone else needs it. I ran into this issue because we needed somewhere to put the OcpSoft PrettyFaces/PrettyTime APIs, which of course needed to be on the OcpSoft website. Yet, WordPress is installed in the root directory, which meant that all requests were going to be sent to the wordpress index.php file (thanks to apache .htaccess)

The solution is simple (as we like it…)

In order to expose a folder under the recent wordpress implementations — add a .htaccess file in each directory you want to expose, and place inside the following line:

/folder/.htaccess

Options +Indexes
And that’s it! The folder contents will be exposed for browsing: Examples of exposed folders here: http://ocpsoft.com/api/ http://ocpsoft.com/repository/ http://ocpsoft.com/xml/

Happy blogging 🙂


Lincoln Baxter, III

About the author:

Lincoln Baxter, III is the Chief Editor of Red Hat Developers, and has worked extensively on JBoss open-source projects; most notably as creator & project lead of JBoss Forge, author of Errai UI, and Project Lead of JBoss Windup. This content represents his personal opinions, not those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing competitive Magic: The Gathering, Lincoln is focused on promoting open-source software and making technology more accessible for everyone.

Posted in OpenSource

One Comment

  1. Emil says:

    Does not work for me. 🙁

Leave a Comment




Please note: In order to submit code or special characters, wrap it in

[code lang="xml"][/code]
(for your language) - or your tags will be eaten.

Please note: Comment moderation is enabled and may delay your comment from appearing. There is no need to resubmit your comment.