Rewrite rule for index.php but not for /www/prettyurl

Hi,
The situation I have a front-end site
in the root (with pretty url like
/shop /aboutus)
and a back-end site in /www
(with pretty url like
/www/admin/index /www/admin/index/index/id/1 )
each with a .htaccess.
htaccess front-end


RewriteEngine On

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule .* index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

htaccess back-end


SetEnv APPLICATION_ENV development


RewriteEngine on
RewriteBase /sharintsito/www/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\\.(js|ico|txt|gif|jpg|png|css)$ index.php

# Security: Don't allow browsing of directories
Options -Indexes

The problem is when I go to for instance
/www/admin/index
the first .htaccess intercept the request
and follow his logic so I’m wondering if there is
a way to skip it.

I tried (in the front-end) with

RewriteRule ^(www)($|/) - [L]

but it doesn’t work

can you help me, please ?

I think it’s the RewriteBase that did you in. Here’s a sampling from the logs that shows how Apache churns things out. (I highlighted what I think are the more important parts.)

strip per-dir prefix: C:/Apache24/htdocs/www/admin/some/path -> admin/some/path
applying pattern ‘\\.(js|ico|txt|gif|jpg|png|css)$’ to uri ‘admin/some/path’
RewriteCond: input=‘C:/Apache24/htdocs/www/admin/some/path’ pattern=‘!-f’ => matched
RewriteCond: input=‘C:/Apache24/htdocs/www/admin/some/path’ pattern=‘!-d’ => matched
rewrite ‘admin/some/path’ -> ‘index.php’
add per-dir prefix: index.php -> C:/Apache24/htdocs/www/index.php
trying to replace prefix C:/Apache24/htdocs/www/ with /sharintsito/www/
strip matching prefix: C:/Apache24/htdocs/www/index.php -> index.php
add subst prefix: index.php -> /sharintsito/www/index.php
internal redirect with /sharintsito/www/index.php [INTERNAL REDIRECT]

strip per-dir prefix: C:/Apache24/htdocs/sharintsito/www/index.php -> sharintsito/www/index.php
applying pattern ‘.*’ to uri ‘sharintsito/www/index.php’
RewriteCond: input=‘C:/Apache24/htdocs/sharintsito/www/index.php’ pattern=‘!-f’ => matched
RewriteCond: input=‘C:/Apache24/htdocs/sharintsito/www/index.php’ pattern=‘!-d’ => matched
rewrite ‘sharintsito/www/index.php’ -> ‘index.php’
add per-dir prefix: index.php -> C:/Apache24/htdocs/index.php

Thanks Jeff but in the hurry I made a mistake it’s


RewriteBase /www/

not


RewriteBase /sharintsito/www/

Well… I don’t know if you’ll like this answer better or worse… but when I make that one simple change, then everything works exactly as expected on my local server. Any chance that there’s more we haven’t seen from your htaccess or from your main config?