You can set a DNS record for your domain. There is even an example in the docs: https://docs.vapor.build/1.0/domains/dns.html#managing-dns-records
Sep 20, 2019
6
Level 5
Redirect non-www to www in Laravel Vapor
Any idea how to redirect non-www to www using Laravel vapor?
Level 88
1 like
Level 2
@vasu_vaadah in case you were referring to hosting your site at www instead of non-www, I was looking around for that today and found you need to change the redirect option in config/vapor.php
/*
|--------------------------------------------------------------------------
| Redirect "www" To The Root Domain
|--------------------------------------------------------------------------
|
| When this option is enabled, Vapor will redirect requests to the "www"
| subdomain to the application's root domain. When this option is not
| enabled, Vapor redirects your root domain to the "www" subdomain.
|
*/
'redirect_to_root' => false,
2 likes
Level 2
@Creative2 that's the one! was also wondering how to do this. Thank you!!
Level 1
Is there any update for this? I can't find any solution over the whole internet. Also ther is no config/vapor.php
Thanks
Level 1
@jancso If you want to change the vapor config file and it does not exist at the moment, you can run
php artisan vendor:publish --tag=vapor-config
1 like
Level 1
@creative2 thanks! Does anyone know how to set this config value per domain instead of globally?
Please or to participate in this conversation.