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 this... -- Where '&qid=3686395' varies from link to link. How can I redirect everything that looks like this '' where it will take care of everything after the 878 to another website.

share|improve this question

I'm assuming your apache is configured to serve ''. In your vhost or .htaccess file (assuming you have Options FileInfo allowed for your domain's documentroot):

RewriteRule ^administrator/components/com_civicrm/civicrm/extern/url.php?u=878(.*) http://someURL/someFile?$1 [L]

that should work.

share|improve this answer
This is the exact string I used. RewriteRule ^administrator/components/com_civicrm/civicrm/extern/url.php?u=878(.*)$1 --------- didn't work. got rid of the [L] since there was stuff underneath it in a different section of the .htaccess. – j Reid Nov 30 '10 at 16:41
try '';. also, do you have a rewrite log enabled? it might be helpful in determining rewrite issues. – DTest Nov 30 '10 at 18:31
also, I suck. I forgot the [R=301] flag, so I would use [R=301, L]. I'm not sure what stuff below this rewrite rule you'd have that you'd want to run after issuing the redirect. – DTest Dec 1 '10 at 18:53

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.