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]