Jump to content

Recommended Posts

Posted

 

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.


 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...