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 need an .htaccess placed in that rewrite (without redirect) all url in /mydir/(.*) to /mydir/index.php?var=$1. If an url is to an exist path or file it's not relevant for me (it must be rewrite).

I can't use +FollowSymLinks, but SymLinksIfOwnerMatch.


share|improve this question
up vote 0 down vote accepted

I think you're looking for something like this:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule (.*) index.php?var=$1

First two RewriteCond's check to make sure the file or directory do not exist. Third checks to make sure you are not looping. It may need to be tweaked based on your server settings, but it should get you going.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.