Nginx Redirect for /stargate/index.php?seite=sga -
i want redirect (only special old url)
/stargate/index.php?seite=sga
with 301
/stargate-atlantis-serienubersicht
how can that?
thanks kay899
you can reference query arguments in nginx $arg_seite
:
location = /stargate/index.php { if ($arg_seite = 'sga'){ return 301 $scheme://your_domain.com/stargate-atlantis-serienubersicht; } # here goes config handling index.php if request came other parameters # or if not needed just: return 404; # important, otherwise return 404 both branches }
the above rewrite ?seite=sga&some-other-param=123
, if not desired - test $args
variable unparsed params
Comments
Post a Comment