Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

duyhuynh's avatar

Set domain for Laravel application in apache server

Dear all,

I am working on the Laravel project. I have deployed it on Apache in Centos 7. I used soft-link command for linking /var/www/html/mypage to my_project/public and it works well with local ip URL 10.200.33.111/mypage.

However, after I linked a domain name www.company.com/mypage, the URL auto replaced from domain name www.company.com/mypage to local ip address 10.200.33.111/mypage when I accessed.

I try to change app_url in .env and run command php artisan config:clear but it does not make any effect. So I want to ask there is any solution for this case?

Thank you in advance

0 likes
1 reply
skoobi's avatar

If you have access to the server SSH then you can change the sym link/soft link to the correct link. Or im pretty sure theres a pre-recieve hook you can tap into with git. So you can add the code there.

Please or to participate in this conversation.