-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking to a deep link fails when used with "path" URL strategy #10565
Comments
Same for me => This works with HashLocationStrategy but not with PathLocationStrategy.
And yes Same :
|
Does your webserver rewrite "subdirectories" (like "/product") to index.html? Make sure it does, the URLs have to be rewritten... I guess this is a precondition to get PathLocationStrategy-routing without the Hash (example.com/#/product) working... Otherwise the webserver is looking for a subdirectory "product" (therefore 404) and the ionic logic won't ever be called in that case... Or am I missing something? e.g. .htaccess Apache:
(I got it working that way, see also https://forum.ionicframework.com/t/how-to-use-deeplinker-in-browser/75787/7) Arno |
Yes that's what I thought too but didn't have time to experiment this option. |
Thanks for opening an issue, we will look into this. |
I am using PathLocationStrategy because I am using ng2-adal which wraps the adal.js library. That library uses a hash to separate the token from the main URL, so the hash path strategy will not work in Ionic and adal together. Everything works correctly except when I try to navigate using the URL or refresh a page with a full path; i.e. http://localhost:8100/project-summary I get an error: Cannot GET /project-summary |
@johnhny Thanks for sharing, that resolved it for me. Just to note for others, this does not resolve the issue when running in Ionic serve, but when serving the files via apache, i.e. when hosting on a server, or locally. |
I don't think this is a bug, but it would be great, if this "issue" would be pointed out in the docs as it isn't obvious, I guess. I'd suggest something like:
|
Is there a way that you can simply enable URL-based routing for local dev? I found this https://github.com/driftyco/ionic-plugin-deeplinks but installing and configuring a plugin seems like overkill just to prevent live reload from redirecting back to the root page every edit. |
I Think that configuration of the redirect can be done in @app-scripts/dist/dev-server/http-server.js when configuring the express server.
I'm sure that, guys from app script can cookup something to check if there is a base in the head of the HTML and add this line programatically, or even simpler add a config for it. |
@yelhouti - Thanks for sharing. Seems to work perfectly. It's a pity we have to edit a dist file from the |
@pjhartin for that you will need to talk to app-script guys, the simplest way is to add a config variable (ex: pathLocationStrategy)
you can even write a pull request for that |
@yelhouti This approach unfortunately does not work when you have proxies configured, because As a quick fix I made:
And below in setupProxies I added
But it probably needs better approach. |
Thank for the info, I was just trying to provide a quick fix for those in need and not confortable digging too deep in the code, of course your solution is much more complete and if you have time I suggesting discussing a fix in ionic-app-script git project and making a pull request for that. thanks in advance |
Any news on this? I can not get it working either. When you reload the page it doesn't work. |
Still seems to be a problem. Can we get update on this one? |
This issue will not be resolved in v3. The next major release of Ionic and Ionic for Angular will change navigation such that we use the Angular router and the Angular CLI which should fix this issue. If this is still an issue at that time, please log a new issue. I am going to close this one as something that will not be fixed in the current major release. |
Thanks for the update! |
So, if this is not fixed, what supposed to be done in case of tabs with path location strategy? Is there any workaround? Or should use hash strategy? Please confirm. |
Any update when this fix will be released? |
Yes an answer would be great |
Hi, i'm on a project using Cordova and facing the same issue :( |
@kensodemann Would it be possible to leave this issue open until the fix is released? This would help me (and other users) have better visibility as to when this issue truly resolved. Thanks for your help in advance! |
When will this release be live ? This is a major issue |
Just to be clear, we are all now talking about Ionic 3, aren't we? |
@kensodemann any idea about when is going to be the new version released? |
@erperejildo - the v4 alpha is getting close. After that it is all a question of how well things go with that. |
Do we have any possible fix for ionic 3 as I desperately need to fix this issue? |
I am building a PWA app along with Android and iOs build and I integrated Google login but google Oauth credentials doesn't support redirect URI along with |
@abdulwahid24 I think you could use that v4 alpha version, right @kensodemann? |
@erperejildo Please so let me know how can I upgrade my existing ionic3 app with ionic 4 alpha release. Thanks |
@kensodemann |
I have the same issue with authentication in mongo stitch app as @abdulwahid24 is stating. How do we get past it meanwhile? |
@abdulwahid24 I don't recommend you any alpha version. Tried (accidentally) the other day and I got some issues. But if you want to try with |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
use APP_BASE_HREF when generating urls from within deep linker resolves ionic-team#10076 resolves ionic-team#10565
use APP_BASE_HREF when generating urls from within deep linker resolves ionic-team#10076 resolves ionic-team#10565
Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x
I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
When in development with ionic serve and using the default hash URL strategy, I can configure a segment like this
segment: 'product/:productId'
. I can successfully navigate to this page and the URL looks like this...http://localhost:8100/#/product/12876
. When I paste the URL into a new browser tab, it comes up again. BTW, beautiful job. I'm so stoked about the simplicity of this "router".When I change the hash strategy to
{ locationStrategy: 'path' }
and set<base href = '/'>
in my index.html file, everything works great when navigating in the app. However, I can no longer reach the page when I paste thehttp://localhost:8100/product/12876
URL into another browser tab. I'm getting a 404.I have not tested this outside my localhost environment.
Expected behavior:
Deep linking should work when using the path locationStrategy.
The text was updated successfully, but these errors were encountered: