Server Fault is a question and answer site for system and network 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'm trying to redirect a url to

My .htaccess file looks like this:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^p=106
RewriteRule /\?p=110 [L,R=301]

But I can't seem to get it to work.

share|improve this question
up vote 1 down vote accepted

According to the docs, you need to check that Options FollowSymLinks is enabled before trying rewrite in a .htaccess. Then, you also have to note that the per-directory prefix is automatically removed, which means a pattern with ^/ never matches anything (I bet this is why your / doesn't work).

So, in your case, first check Options FollowSymLinks and then change the RewriteRule to be something as covener suggested, or my version:

RewriteRule ^$ /?p=110
share|improve this answer

RewriteRule / wouldn't match a request to / in htaccess. The path you compare against is empty in that case (the prefix is stripped in htaccess rewriterule)

RewriteRule ^$ 
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.