August 2017
Intermediate to advanced
278 pages
8h 53m
English
If you've moved a page or have a new CMS, you can redirect each page using the following:
rewrite ^/originalpage/$ /newpage/ redirect;
This simply has to be within your server block directive. It's important to note that the syntax needs to be an exact match. In the preceding example, if you called the URL without the trailing slash, it would fail to redirect. We can account for both these scenarios by modifying the rewrite directive quickly:
rewrite ^/originalpage/?$ /newpage/ redirect;
As explained in detail later, this means that the trailing slash is now optional, so that both call to /originalpage and /originalpage/ will now both redirect.
Read now
Unlock full access