开发者

Cherokee redirect

My开发者_运维知识库 server is running Cherokee and I'm trying to get a redirect to work. I'm running into troubles with infinite redirect loops because I am redirecting to the same folder.

My URL is:

http://domain.tld/example-variable (http://domain.tld/product-1234)

This needs to be redirected to:

http://domain.tld/index.php?item=variable (http://domain.tld/index.php?item-1234)

The Regex I have tried is:

^/product-(.*) /index.php?item-$1

This redirect is working. However, http://domain.tld is now broken as well as files like images (http://domain.tld/image.jpg). Other redirects I'm using are working just fine, but they redirect a folder to another folder (i.e. /folderA to /folderB).


have you tried making the rule non-final and the ordering is correct? typically, those two will cause the sort of issue you're seeing.


@brent I've tried that indeed and all combinations I could think of where not solving the problem.

I ended up using a subdomain:

product.domain.tld/1234

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜