Nginx Redirect Rule with a anchor tag

by jackhammer013   Last Updated March 13, 2018 05:00 AM

I have an existing redirect rule

location ~* "^/view-price-range.php" {
    return 301 $scheme://www.mysite.com.au/pricing/;
}

Is it possible for nginx to detect anchor tag and have a redirect rule?

For example view-price-range.php#mytag

What I want is if that url is being requested it will go to /pricing/ as well.

So tried:

location ~* "^/view-price-range.php#mytag" {
    return 301 $scheme://www.mysite.au/pricing/;
}

And not working. I am not sure if the # in the url is being evaluated as comment in nginx?



Related Questions




In Nginx is there a way to log 301 redirects?

Updated June 09, 2017 17:00 PM

Proxy server redirecting users to one URL

Updated July 21, 2017 06:00 AM

Can't redirect http:// to https:// via nginx

Updated August 22, 2017 09:00 AM