I need to redirect a URL in nginx. My rule looks like this which actually causes the browser to visibly change the URL, which is not what is expected.
location / {
rewrite ^/dentists/bangalore/indiranagar/$ http://abc.com/doctorsInArea.htm?cID=bangalore&aID=indiranagar break;
}
I read another question here nginx rewrite WITHOUT change url which tells me to remove the http part . I tried
location / {
rewrite ^/dentists/bangalore/indiranagar/$ /doctorsInArea.htm?cID=bangalore&aID=indiranagar break;
}
This one throws a 404 even though http://abc.com/doctorsInArea.htm?cID=bangalore&aID=indiranagar works fine when hit from the browser. Any insights on the problem would be apprreciated.