question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subdomain not changing when navigating using inertia-link

See original GitHub issue

Versions:

  • @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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
victorlapcommented, Jun 30, 2021

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.

1reaction
claudiodekkercommented, Jun 27, 2021

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-redirects

Hope this helps!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found