我想将多个重写条件组合到一行中。
选项可以像这样组合:
Options -Indexes
Options -Multiviews
-> Options -Indexes -Multiviews我也想把RewriteConds结合起来。下面是当前的代码
Options -Multiviews -Indexes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1
RewriteEngine On [QSA]我想像这样改变它:
Options -Multiviews -Indexes
RewriteCond %{REQUEST_FILENAME} !-d !-f !-l
RewriteRule ^(.+)$ index.php?url=$1
RewriteEngine On [QSA]有什么方法可以结合起来吗?
发布于 2019-01-26 18:19:15
很抱歉你不能。如果你尝试上面的任何一个,你会得到一个500服务器错误。我试图获得一个解释htaccess基础的链接。请检查https://getpostcookie.com/blog/url-rewriting-for-beginners/,RewriteEngine On应放在第一位。最佳实践,每个.htaccess文件只能使用一次
https://stackoverflow.com/questions/54377084
复制相似问题