Why iOS Changes Your PWA URL When Adding to Home Screen (Fix & Causes)
When you add a web page to the iPhone home screen, the saved icon may open a different URL from the one you were viewing. I ran into this problem while building Petal. What I wanted was simple: open an individual page like /petal/{token} and add that exact page to the home screen. But in reality, when I opened it from the home screen, it jumped to another URL like /petal/@username. At first, I thought it was Safari cache or some mysterious iOS behavior. But the conclusion was much simpler. The cause was that I had written a fixed URL in start_url inside manifest.json. It was completely my mistake. The confusing part was that this mistake did not appear clearly from the beginning. What happened What I wanted to do was very simple. Open a different Petal card page for each user Add that page to the iPhone home screen Open that person’s page directly from the next time In other words, I wanted to keep the exact URL that was currently open on the home screen. But when I […]
