I have several problems rewriting the rules for a specific subdirectory (other than webroot), and I donβt understand where to put them.
/ var / www / (webroot containing WordPress) / var / www / (containing another application that requires its own rewrite rules)
Below are the i rules for WordPress, which are located in the webroot directory (/ var / www or http://mywebsite.com ):
$HTTP["host"] =~ "mywebsite.com" { url.rewrite-final = ( # Exclude some directories from rewriting "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", # Exclude .php files at root from rewriting "^/(.*.php)" => "$0", # Handle permalinks and feeds "^/(.*)$" => "/index.php/$1" ) }
Then I have a second application, which is located in the webroot subdirectory (/ var / www / subdirectory or http://mywebsite.com/subdirectory ) with the following rules:
url.rewrite = ( "(index.php|test.php|favicon.ico)" => "/$1", "(css|files|img|js)/(.*)" => "/$1/$2", "^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3", )
I need the first set of rewrite rules to apply to everything except the other directories in the above #Excluded rule (as well as the / subdirectory), and then the second set of rules that apply only to the / subdirectory
I got the first set of rules for WordPress from a blog somewhere on the Internet, everything may not be exactly what I need (in terms of matching "mywebsite.com" and probably can be simplified).
I searched for myself, trying several options (basically just stabbing in the dark, guided by random forum posts that are a bit related), but I just can't wrap my head around it.
So, how would I use the second set of rules for a subdirectory while saving Wordpress rules for the root?
Note. I do not have access to subdomains (that would be too easy).