0

I am trying to redirect the following URL by adding a trailing slash

http://mywebsite.com/download (main CMS will take over to show page not found)

to

http://mywebsite.com/download/ (another standalone script will take over in this folder)

I tried to search on the Internet and although there are plenty of info for adding trailing slashes for all URLs in the site, I ONLY WANT to add to the "download" segment, but can't find any info on this.

Thank you.

1 Answer 1

4

Add the following line to your config file. return 301 http://$host$uri/ ; in location /download part. like below

location /download {
  return 301 http://$host$uri/ ;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, it worked! I have changed https to $scheme: return 301 $scheme://$host$uri/;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.