0

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).

DivZero
  • 2,438
  • 2
  • 24
  • 23

2 Answers2

0

@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

DivZero
  • 2,438
  • 2
  • 24
  • 23
0

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 saner
  • 412
  • 1
  • 5
  • 9