WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WPMU install with a couple of sites on it. I'd like to add some subdirectories that are not wordpress blog pages but do contain working PHP code. They do not use any of wordpress's libraries and are not plugins.

The catch is that I'd like these subdirectories to only show up on a particular site. For instance, the hierarchy is:




should work while


should give a 404 error. Is there anyway to do this? I'm running Wordpress through Windows Server IIS7 if it is any help.


share|improve this question

With the Apache web server, one would create a rule in the .htaccess file.

I believe the equivalent in IIS7 is the web.config file. This page appears to point in the right direction.

I would be more specific about where to place the file or how to construct the rule, but I have no experience with IIS7.

share|improve this answer
Thanks for your help! I was able to figure it out from the link – OSMman Jan 1 '13 at 22:03
up vote 0 down vote accepted

I added the following section to the top of my web.config rewrite rules section:

<rule name="Movies Redirect" stopProcessing="false">
    <match url="\/?movies\.*" />
        <add input="{HTTP_HOST}" pattern="^.*dawson\.osmblags\.com.*$" negate="true" />
    <action type="Rewrite" url="{C:0}" />

This is working. Anytime someone attempts to go to something.osmblags.com/movies it redirects them back to something.osmblags.com rather than allowing them to view the custom code section. It limits the available permalinks but works fine for my purposes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.