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 WordPress site. It works great. But I have a subdirectory on my server where I work on client websites. It's a development space and most of those sites are NOT WordPress. Sometimes (but not all the time?) my site's WordPress theme will takeover a page and mess up all my styles.

I don't care so much about WHY this is happening... but how do I prevent it? I assume I need to edit my .htaccess with some extra line of code.

Alright, here's a page that's being corrupted by WP styles:

Notice the header and footer; the middle section is broken right now anyway.

share|improve this question
You should care about why is happening because if you dont know why is happening you won't can prevent it. Can you clarify exactly what happens? Wordpress takes styles CSS files from the subdirectoy you want to block? Wordpress execute the URL request to the subdirectory as own? – cybmeta Sep 5 '13 at 19:47
please be more specific. Add some url examples what subdirectory you want to allow and what not. – rahilwazir Sep 5 '13 at 21:10
I've edited my OP with a couple examples. Noticeable in header and footer the most, my WP theme is overwriting some CSS styles I have in a non-WP subdirectory. – danfo Sep 10 '13 at 18:38
you have the contents of your theme's header.php being injected into the middle of your html page, I presume this is the result of something you're doing in the code on that particular page. – Milo Sep 10 '13 at 18:45
Yeah... I should've noticed that. It's from a broken SSI. As a result, server returns a 404 which WordPress tries to intercept. Thanks for the observation. – danfo Sep 10 '13 at 21:05
up vote 0 down vote accepted

Turns out my trouble was caused by a stray server-side include that was returning a 404, which WordPress tried to intercept.

This is not the WordPress problem you are looking for.

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.