我想将[网站] / purchase / configure / quotation /重定向到[网站] /purchase/index.php。我将.htaccess文件放置在[website] / purchase /中,并遵循以下规则:
RewriteRule "configure/quotation/?$" "index.php" [NC,L,QSA]
但是它不起作用。经过多次试验和错误,我发现以下规则有效:
RewriteRule "quotation/?$" "index.php" [NC,L,QSA]
RewriteRule "/quotation/?$" "index.php" [NC,L,QSA]
RewriteRule "configure(.*)quotation/?$" "index.php" [NC,L,QSA]
但是这些不是:
RewriteRule "configure/quotation/?$" "index.php" [NC,L,QSA]
RewriteRule "e/quotation/?$" "index.php" [NC,L,QSA]
显然,如果字符/前面有另一个字符,则不能正确处理。如果未在其前面(如在“ /引号中”)或将其处理为任何字符(如在“(。*)”中),则该规则可以正常工作。
这让我发疯。 :-)
我正在使用Windows 10,Apache 2.4.39和https。