根据这个answer https://stackoverflow.com/a/3414030/3817111,您可以从重定向中排除单个子文件夹,如下所示:
RewriteEngine on
RewriteRule !^uploads($|/) http://example.com%{REQUEST_URI} [L,R=301]
我如何扩展它以包含两个或更多单独的子文件夹?
如果您遵循,可能会更容易阅读和维护不同的答案 https://stackoverflow.com/a/12144956/1824988对于你提到的问题。
RewriteEngine on
# Do not rewrite these directories
RewriteRule ^(uploads) - [L]
RewriteRule ^(second) - [L]
# Rewrite all other URL
RewriteRule (.*) http://example.com/$1 [L,R=301]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)