I am guessing that as laravel forge is providing vps service with ssh access you should be able to update your nginx config file (if your using nginx as your http service) to do so. Within mine I have the following at the top of each of my domain config files to redirect all non www traffic to the with www-prefix domain:
# non-www to www redirect
server {
listen 80;
server_name photogabble.co.uk;
return 301 $scheme://www.photogabble.co.uk$request_uri;
}
It is of course a 301 so that google and other search engines index correctly.
If you need more specific details let me know and I can give you a walk through.
when i add this i get redirect loops any idea why this might happen? you can see a post about my issue here https://laracasts.com/discuss/channels/forge/redirect-loop-for-non-www-domains-to-www-domain
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community