Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am shocking at mod_rewite, here's the scenario:

I need a rule that rewrites to

The rule, or set of rules rather, must also rewite to, and work in a similar fashion for any subdirectory, for example: must redirect to

The rules must also work with or without the trailing slash, for example: ….com or ….com/.

Thank you all, your help is much appreciated!

If you could outline how and why your solution works or direct me to a good resource that explains it, I'd be exceptionally grateful!

Edit: I have got a simple .htaccess file with this:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^$ http://mydomain.local/~Jay/some_awesome_app/app/views/home/home.php

This does the redirect but changes the URL in the address bar too! I've not got a trailing [R] flag so why would this be?

share|improve this question
Solved the Edit: should read `RewriteRule ^$ /~Jay/some_awesome_app/app/views/home/home.php – Jonathon David Oates Feb 11 '11 at 14:05
up vote 0 down vote accepted
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^$ /~Jay/awesome_app/app/views/home/home.php [L]
RewriteRule ^([a-z0-9_]+)/?$ /~Jay/awesome_kindle_app/app/views/$1/$1.php [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.