Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Why is it that when I write the directive Alias /hello /myfile.php it works fine, but if I write Alias /hello /myfile.php?myvar=test apache gives me 'NOT FOUND'.

share|improve this question
up vote 4 down vote accepted

According to the docs, the alias target can only be a file or path. Is suspect you don't have a file literally called myfile.php?myvar=test on your filesystem.

You might be able to do this with rewrite rules, but in this case, it sounds much easier to handle the default parameter in your script itself.

share|improve this answer
Alternatively, the OP could probably RedirectMatch ^/hello$ /myfile.php?myvar=test, but this is not invisible to the end user. – Ulrich Schwarz Nov 22 '12 at 8:12
Yes, good point but that seems more "intrusive" as you say than a rewrite (or not modifying the URL at all and handling in the program). Not really sure this is on topic here actually. – Mat Nov 22 '12 at 8:36

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.