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

this may seem like a weird question but I have something working and I don't understand how.

I have moved my wordpress install to a subdirectory and am using the .htaccess file to redirect anything that is not in another folder A to the blog folder B.

RewriteCond %{REQUEST_URI} !^/A/.*$
RewriteRule .* B/$0  [L]

I am also using the Webphysiology Portfolio plugin and am calling the shortcode for it in a page called Portfolio. The images displayed by the plugin have their path set in the form /portfolio/wp-content/rest-of-url-etc (which is not the actual physical path) and this was causing problems with displaying them in the lightbox which could not find the images.

To fix this I added a rule before the other one:

RewriteCond %{REQUEST_URI} ^/portfolio/(.*)$
RewriteRule .* B/%1  [L]

This fixed the lightbox problem as expected but after fixing it I thought it will mess up my portfolio page display which has the path /portfolio/ and hence matches this rule.

But it is working. Can anybody please explain why?


share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.