If the folder contains 2 letters (example: zz) then execute file (foofile) without redirecting to it. foofile’s text output is to be shown on the browser.
URI accessed by browser:http://www.mysite.com/zz/folder1/file1 File to be executed: http://www.mysite.com/foofile?var1=zz&var2=/folder1/file1
This is not working since the browser shows a 404 (not found) error:
RewriteCond %{REQUEST_URI} ^/../.*$
RewriteRule ^/(..)(/.*)$ /foofile?var1=$1&var2=$2
Try to remove preceding slashes in your
RewriteRule:And your
RewriteCondisn’t necessary.