Nginx – Redirect a specific url

A client wants the old .aspx path could redirect the visitor to another URL. I don’t want to make the server to host a .aspx file so i add the redirection in the Nginx virtual host config.

Add the following lines insider the server { … }.

## Special redirect for the following
## old xxx.aspx to eureka.ykyuen.info
location /xxx.aspx {
  return 301 $scheme://eureka.ykyuen.info;
}

 

Done =)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.