0

I'm try to redirect an URL but nothings happen. :( The source URL example like this:

http://example.com/download.php?shortURL=MJdcqV

Where the MJdcqV is a variable parameter, all others constant. I need to redirect looks like this:

http://example.com/views/download.php?shortURL=MJdcqV

I'm try to rewrite with many way, but not find the right way:

location /download.php {
        rewrite ^/download.php$ /views/download.php redirect;
        rewrite ^/download.php$ /views/download.php break;
        rewrite ^/download.php$ /views/download.php last;
}

Please gime me some advice or pointing me for the right way. Thank you

1
  • Do you want the user's browser to get a redirect, that is, see the redirected URL, or do you want the redirect happen only at server end? Aug 2, 2015 at 11:45

1 Answer 1

0

Try

location = /download.php {
  rewrite ^ /views/download.php$is_args$args last;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .