如果該文件夾包含2個字母(例如:zz),則執行文件(foofile)而不重定向到它。 foofile的文本輸出將在瀏覽器上顯示。.htaccess RewriteRule without Redirect
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
這是行不通的,因爲瀏覽器顯示404(未找到)錯誤:
RewriteCond %{REQUEST_URI} ^/../.*$
RewriteRule ^/(..)(/.*)$ /foofile?var1=$1&var2=$2