I am using nginx as reverse proxy with apache for my website. I have pretty url's enabled for SEO purpose, with NGINX rewrite URL's.
for example the pretty url :
mysite.com/song/I-love-music
works for this ugly url :
mysite.com/song.php?url=I-love-music
And it works perfectly.
But I have an issue now, if someone visits this type of urls directly
mysite.com/song.php?url=I-love-music
Then this url is loading properly , same as
mysite.com/song.php?url=I-love-music
It is a big problem for SEO purpose, I need this ugly url to permanently redirected to this pretty url :
mysite.com/song/I-love-music
Please help me how do I rewrite urls in NGINX for this. I tried with apache rewrite rules in htaccess but that gives me server error..