I am using Apache2 with the following (good) .htaccess
at the root of my site,
#OLD (GOOD, IS WORKING!)
# If requested url is an existing file or folder, don't touch it
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
RewriteRule ^(urn|URN):(.+)$ index.php?urn=$2 [L]
RewriteRule ^([a-zA-Z\d\-]+)$ index.php?obj=$1 [L]
Now I need to merge a new condition for the folder xWiki
#NEW: some conflicts, how to preserve old and add /xWiki* behaviour?
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^xWiki/?(.*)$ /xWiki/index.php?title=$1 [L,QSA]
How to "merge" preserving old behaviour except to /xWiki
?
Only adding the RewriteRule ^xWiki/?(.*)$
not works, and the !-f
is in conflict with the same -f
cond...
Have it this way:
#OLD (GOOD, IS WORKING!)
# If requested url is an existing file or folder, don't touch it
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
RewriteRule ^xWiki/(.*)$ /xWiki/index.php?title=$1 [L,QSA]
RewriteRule ^(urn|URN):(.+)$ index.php?urn=$2 [L,QSA]
RewriteRule ^([a-zA-Z\d\-]+)$ index.php?obj=$1 [L,QSA]
RewriteRule
in the correct place (before other RewriteRules), and undertand that there are no conflict with -f
and !-f
(no changes in the -f
is the merge solution).^xWiki/?(.*)$
to ^xWiki/(.*)$
.