Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将/directory1/directory2/除 PDF 文件之外的 directory2 ( ) 中的所有内容重定向到静态 URL。这可能吗?
/directory1/directory2/
对的,这是可能的。将此代码放在root .htaccess:
root .htaccess
RewriteEngine On # it doesn't end with .pdf RewriteCond %{REQUEST_URI} !\.pdf # URI starts with /directory1/directory2 then redirect RewriteRule ^directory1/directory2/(.*)$ /some-where/$1 [L,NC,R]