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

I am having an issue getting a specific rewrite requirement working on lighttpd/mod_rewrite.

We have a folder that is called "/app/" with another folder inside that "/app/admin/"

"/app/index.php" is used for a bunch of SEO friendly urls. But the "/app/admin/" folder does not have any SEO friendly urls.

I am trying to get any request to "/app/*" to use index.php UNLESS it is going to the "/app/admin/" folder or if it is going to a PHP file.

I have been unable to get this working without a bunch of infinite loops taking place.

Here is the lighttpd mod_rewrite conifig:

url.rewrite-if-not-file = (
    "/admin$" => "/admin/index.php",
    "/admin/.+(?!\.php)$" => "/admin/index.php",
    "/.+(?!\.php)$" => "/index.php",
)

Here is the rewrite config from our apache install which was working:

RewriteBase /app/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /app/index.php [L]
share|improve this question
What location is being sent with the redirect? – Shane Madden Jul 17 '12 at 2:18

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.