Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

It should first check if the first /$1/ is a directory and if not add a directory before it.


1- pizza
2- pizza/olives

Should rewerite the url to:

1- menu/pizza
2- menu/pizza/olives

How is this done?

share|improve this question

1 Answer 1

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ http://mysite.com/menu/$1 [L,QSA]
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.