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

nutricula's avatar

Broken images after moving to subdomain

I recently changed my Spark installation over to a subdomain, and updated my .env file to reflect this. Sadly, all of my profile images are broken, and still reflect the original domain. I did run cache:clear and view:clear, however the result is the same. Any thoughts?

0 likes
4 replies
nutricula's avatar

Thanks jbloomstrom. I originally did that (and it was working until I moved to the subdomain), however just to be safe I remove the symbolic link and readded it with the php artisan storage:link command. Images still broke.

To clarify, I built a test site with Spark on domain.com. I move the Spark app to go.domain.com, and that is when the images broke. I updated my .env file to reflect the new domain, however that didn't resolve it. If I view the path of the image, it shows domain.com/storage/profiles/image.jpeg. If I add go. in front of it, that image loads, which tells me that the symbolic link is working. Any other thoughts?

Cronix's avatar
Cronix
Best Answer
Level 67

The problem is Spark stores the image path in the database using the url. If you look at the photo_url field in the users table they will all be http://youroldurl.com/..../image.png

So you need to clean it up at the database level and replace the old url in that field with the new one. I don't know why they did that...

nutricula's avatar

Thanks Cronix, that indeed was the issue. I updated my values in the photo_url column and confirmed this resolved the issue.

Please or to participate in this conversation.