我的服务器正在运行Cherokee,我正在尝试重定向到工作。我遇到了无限重定向循环的麻烦,因为我正在重定向到同一个文件夹。
我的URL是:
http://domain.tld/example-variable (http://domain.tld/product-1234)
需要将其重定向到:
http://domain.tld/index.php?item=variable (http://domain.tld/index.php?item-1234)
我尝试过的正则表达式是:
^/product-(.*) /index.php?item-$1
此重定向正在工作。然而,像图像(http://domain.tld/image.jpg)这样的文件一样,http://domain.tld现在也被破坏了。我正在使用的其他重定向也工作得很好,但它们将一个文件夹重定向到另一个文件夹(即/folderA到/folderB)。
发布于 2012-12-09 19:35:04
@brent我确实试过了,我能想到的所有组合都解决不了这个问题。
我最终使用了一个子域:
product.domain.tld/1234
发布于 2011-10-02 12:09:23
您是否尝试过将规则设置为非最终规则,并且顺序正确?通常,这两个会导致您所看到的那种问题。
https://stackoverflow.com/questions/6847282
复制相似问题