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 would like all the URLs of the following format:

to display:

How can I do this?

share|improve this question
up vote 1 down vote accepted

it should work if you put this in .htaccess (given that mod_rewrite has been enabled on your webserver and you have the right to use it):

RewriteEngine On
RewriteRule ^/xyz$ /show.php?keyword=xyz [R=302,L]
share|improve this answer
Err, I meant xyz as a variable, not literally "xyz". Does this work for a that? – Hilbert Apr 22 '12 at 22:22
Oh, I see. Is it just a regular expression? – Hilbert Apr 22 '12 at 22:30
Would RewriteRule ^/([a-zA-Z]*)$ /show.php?keyword=$1 [R=302,L] work? – Hilbert Apr 22 '12 at 22:30
Yes, you could do that, you should just care that you don't create a loop. If the catching part also matches show.php you will be bricked. – daudo Apr 24 '12 at 8:12

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.