0

I currently have the location alex/ available for users:

location ~* ^/alex/ {
rewrite ^/alex(/.*)$ $1 break;

I need to

  1. add a new location, /alexandru;
  2. make a permanent redirect from example.com/alex to example.com/alex/.

I have created the new location with location /alexandru and it works well, but when i try to use rewrite ^/alex(.*)/$ /$1 break; for the permanent redirect it fails.

Alex
  • 287
  • 2
  • 9
  • 17

1 Answers1

1

quick and dirty solution:

location /alex {
   rewrite ^/alex(.*) http://$server_name/url_to/alexandru$1 permanent;
 }
semm0
  • 947
  • 7
  • 18