I'm having problems with the following while config. on my Apache server to Rewrite some urlsURLs.
SetEnv PATH_TO_DIR /directory
RewriteRule ^%{PATH_TO_DIR}/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-\.]+)/?$ /index.php?dir=$1&file=$2
ErrorDocument 404 %{PATH_TO_DIR}/index.php?dir=null&file=error
This conf.config used to work perfectly fine until I used SetEnv PATH...SetEnv PATH
etc. I need to use this because there are lots of rules, not just those mentioned above.
Can anyone point out my mistake?
Apache returns
%{PATH_TO_DIR}/index.php?dir=null&file=error
when I try anything (www.site.com/foo/barwww.site.com/foo/bar
for instance).
Apache returns the ErrorDocument if iI just try to fetch the index.
I know it's not a problem with the rewrite rules because they work when I remove the PATH_TO_DIR variable and just hard code it.
Thanks!
A.