Nginx Redirect Rule with a anchor tag

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

I have an existing redirect rule

location ~* "^/view-price-range.php" {
    return 301 $scheme://;

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://;

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