Hi,
I have already followed the Custom Nginx Includes in Trellis | Trellis Docs | Roots docs. But maybe I am getting something wrong?
I am trying to setup the following redirects:
https://www.mydomain.co.uk/wp/app/uploads/sites/9/
to
https://www.mydomain.co.uk/app/uploads/sites/11/
wordpress_sites.yml
wordpress_sites:
nonecom.comfygroup.com:
site_hosts:
- canonical: www.mydomain.co.uk
redirects:
- mydomain.co.uk
local_path: ../non-ecom-site
I have therefore setup the following file/folder structure:
/trellis/nginx-includes/www.mydomain.co.uk/media-url-redirects.conf.j2
And the contents of that conf file is:
{{ ansible_managed }}
Redirect old Gravity Forms uploads from /sites/9/ to /sites/11/
location ~ ^/app/uploads/sites/9/(.*)$ {
return 301 /app/uploads/sites/11/$1;
}
Also catch any accidental /wp/app/uploads/ prefix
location ~ ^/wp/app/uploads/sites/9/(.*)$ {
return 301 /app/uploads/sites/11/$1;
}
So far my nginx config/redirects are not being applied to the server at all. Is there any obvious setup issue so far? Thanks.
Notes, my wordpress_sites file has many more domains, but I have removed for security. This redirect should apply for the mydomain.co.uk domain only.