0
我试图自动将所有.PDF和.pdf文件从网站根重定向到名为docs的子目录。.htaccess重写从根目录到子目录的PDF
请注意,网站根目录上没有任何实际的PDF文件,这就是我试图使用!-f位的原因。
这是我到目前为止,但它不工作。我将不胜感激任何帮助。
# redirect PDF files requested on the root '/' to /docs/<filename>.(pdf|PDF)
Options +SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.(pdf|PDF))$ /docs/$1
这样做 - 谢谢! – 2012-08-10 19:55:26