- This passes on the path, eg:
/contact-us, as part of the redirect - When using a separate 'site' in Laravel Forge.
- Implement the below first
- Then add each domain and issue a certificate
Look for something like this in the nginx.conf interface:
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/00000000/server/*;
Ensure the following is included and update the redirect destination domain.
# Handle Let's Encrypt first and stop processing other blocks
location ^~ /.well-known/acme-challenge/ {
allow all;
}
# Redirect (that won't affect Let's Encrypt)
location / {
return 301 https://destination-domain.co.uk$request_uri;
}
# Security: Deny other hidden files
location ~ /\.(?!well-known).* {
deny all;
}