Tag Info

New answers tagged

0

<rule name="everything to index"> <match url="^(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php?q={R:1}" /> </rule>


0

If you just have one (or maybe a few) of these to match exactly, then you can check the argument explicitly. if ($arg_id = "learn-More"} { return 301 $scheme://$http_host$uri?id=learnMore }


0

You cannot match query strings in nginx rewrite directive. You have to do something like this: location ~* /(?<p1>[a-z]+)-(?<p2>[a-z]+)-(?<p3>[a-z]+) { if ($args ~ id=(?<q1>[a-z]+)-(?<q2>[a-z]+)) { rewrite ^ http://example.com/$p1$p2$p3?id=$q1$q2 permanent; } } Here we use regular expression captures to ...


0

You will need to escape the ? in the regular expression; as it stands, it indicates that the c is optional. Try: rewrite ^/a-b-c\?id=learn-More http://example.com/abc?id=learnMore permanent



Top 50 recent answers are included