ibra Posted 1 hour ago Posted 1 hour ago Problem: After pointing the domain example.com to Johnny (HelioHost), the site was redirecting to helionet.org instead of loading the Laravel application. At first this looked like a DNS or .htaccess misconfiguration. However, the real cause was inside Laravel’s environment file (.env): APP_URL=https://johnny.heliohost.org/ ASSET_URL=https://example.helioho.st/public Because APP_URL was set to the server’s default domain (johnny.heliohost.org), Laravel generated all links and redirects to that domain. This made the site appear as if it was stuck on helionet.org. Solution: Update the .env file so Laravel knows the correct production domain: APP_URL=https://example.com ASSET_URL=https://example.com Then clear Laravel’s cached configuration: php artisan config:clear php artisan cache:clear Now all redirects, assets, and generated URLs point to example.com correctly. Explanation: - DNS records were already correct, pointing example.com to Johnny’s IP. - Apache/.htaccess was fine, routing requests into Laravel’s public folder. - The problem was application-level misrouting: Laravel used APP_URL to decide what domain to generate links for. - Since APP_URL was set to johnny.heliohost.org, every redirect and asset URL pointed to the wrong domain. By fixing APP_URL and ASSET_URL, Laravel now generates URLs for the right domain (example.com), resolving the misrouting. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.