I am using Nginx, and I want to rewrite all url with the following two params:
title=%E7%89%B9%E6%AE%8A
and
from=(any datatime)
to home page.
I don’t know how to write the rule, would any one help me?
Edit:
I want to rewrite urls like:
http://example.com/index.php?days=30&from=20120122083408&limit=250&title=%E7%89%B9%E6%AE%8A
or
http://example.com/index.php?from=20120622063000&limit=20&title=%E7%89%B9%E6%AE%8A
or
http://example.com/index.php?from=20030422063000&title=%E7%89%B9%E6%AE%8A
to
http://example.com
Nginx doesn’t support logical AND operation, but we could use “little hack”:
This should help you:
P.S. You also could use 302 redirect, to directly move user to / .