Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

.htaccess rules are not taking effect when there is a query string containing another domain URL in the URL.

I have main WordPress website installed in the domain root and a development website located in /dev subfolder.

Here's an example:

http://domain.com/dev/some-url works without problems
http://domain.com/dev/some-url?redirect_to=http%3A%2F%2Fotherdomain.com triggers page not found on the root website, meaning something is wrong with the rules.

Here's the .htaccess file I'm using:

# BEGIN WordPress
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
# END WordPress

I have tried adding RewriteCond %{REQUEST_URI} !^/(dev)/ after the RewriteBase line but no success.

Any ideas what is the problem here?


share|improve this question
Line http://domain.com/dev/some-url?redirect_to=http:%3A%2F%2Fotherdomain.com, is the : before %3A a typo or really there? If it is not a typo, that maybe the problem. Let me know if I should move this to answer. –  John Siu Jan 21 '13 at 16:29
It's a typo; thanks for spotting that. I fixed it in the answer. –  Ivanhoe123 Jan 21 '13 at 16:36

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.