Subdomain not changing when navigating using inertia-link
See original GitHub issueVersions:
@inertiajs/inertia
version: 0.9.2@inertiajs/inertia-vue3
version: 0.4.7
Describe the problem:
Let’s say you have Laravel named routes like:
'dashboard.home' => 'dashboard.example.com/home',
...
'account.settings' => 'account.example.com/acc/settings',
When you are in dashboard.home
page, clicking the <inertia-link>
that has href
linking to account.settings
will bring you to the page.
However, the address bar is showing https://dashboard.example.com/acc/settings
, this will cause a 404 error when user refresh the page as the correct URL should be https://account.example.com/acc/settings
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Laravel Inertia apps doesn't support subdomain redirects #431
I'm working on a Laravel 9, InertiaJS and vue project where a user can submit a new product ... Same behavior occurs with...
Read more >Subdomain routing not working in Laravel 9 and Inertia
After a lot of researching, After days of research I'm sure now that it is impossible to route redirect to a subdomain route...
Read more >Subdomain routing not working and working at the same time
Subdomain routing not working and working at the same time. I'm working on a Larave, Inertiajs and Vue project where I want every...
Read more >The Ultimate Guide to Inertia.js - Kinsta
A look at how Inertia.js makes constructing single-page applications a piece of cake, while solving other problems for developers.
Read more >Links - Inertia.js
To create links within an Inertia app you'll need to use the Inertia link component. ... However, you can change the tag using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe this should happen automatically? If inertia sees a url with a differenet origin, it should force a reload, as otherwise you would end up on not existing pages. You cannot always do this server side, for example when not all routes in the navigation are on the same origin.
Thanks @RobertBoes!
@luiyongsheng Given that this isn’t possible / cannot be possible, I’m going to close this issue. On top of what @RobertBoes already mentioned, you may use
Inertia::location
for this: https://inertiajs.com/redirects#external-redirectsHope this helps!