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

Here's what I'd like to do:

If a user goes to, I'd like to redirect to a particular script and give it "thislocation" as a parameter.

So if a user navigated to, I'd like to redirect to, and similarily, if the user navigated to, I'd like to redirect to

Is this possible with Apache?

share|improve this question
up vote 1 down vote accepted

You could achieve this by using .htaccess and the code for this is:

RewriteEngine on
RewriteRule ^(.*)$ /cgi-bin/$1 [L] 
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.