9951 explained code solutions for 126 technologies


nginxHow to redirect


server {
  rewrite ^/old$ /new redirect; 
}ctrl + c
server {

virtual server configuration block

rewrite

define URL rewrite rule

^/old$

regex to match urls to redirect

/new

new url to redirect to

redirect

ask Nginx to do a real redirect instead of silent rewrite