I have realised that there are some subfolders in the directory that I am dealing with that I do not want to rewrite to the tracking script at all so I need to put in a condition that does not rewrite requests to:
/directory/sub1
/directory/sub2
/directory/sub3
Not quite sure on the correct syntax for doing that.
Try
- Code: Select all
RewriteCond $1 !^(sub1|sub2|sub3)(/.*)?$ [NC]
or
- Code: Select all
RewriteCond %{REQUEST_URI} !^/directory/(sub1|sub2|sub3)(/.*)?$ [NC]
Also I use domain aliases so is it possible to use something like the following in place of example.com:
You cannot use variables in RewriteCond (or RewriteRule) patterns. Try
- Code: Select all
RewriteCond %{HTTP_HOST}/%{HTTP_REFERER} !^([^/]+)/\1(/.*)?$ [NC]
Finally is the rewrite rule:RewriteRule ^(.*)$ /Tracking/index.php?Path=directory/$1 [NC,QSA,L]
still root relative or is it realtive to the directory where the .htaccess file is residing?
Relative to the .htaccess file.