I’m in a similar situation, but I cannot seem to get this path-based location strategy to work.
Every time I try to navigate to a page I only see: Cannot GET /test
I’ve tried implementing using the method you describe, and also the methods discussed here: https://github.com/driftyco/ionic/issues/5479#issuecomment-185267794
I can only get hash based navigation working alongside the deeplinker, but not path based.
Are there any additional steps you are taking that I may be overlooking?
You would need to rewrite (not redirect) in your web server all the routes for your application to load /, and therefore the Ionic’s index.html. Otherwise your web server will try to load the index file at directory /test, which doesn’t exist.
I too am having the same issue. I should not have to rewrite my routes from the server. If I refresh my page running the local server it should work the same way it does when using the hash location strategy.
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. 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 was using the path locationStrategy under the assumption that it would work within Ionic serve. I did, however, enable the path based routing by hosting the files locally, and on our remote apache server, and using the following .htaccess confg:
I’m still not 100% sure this is the recommended method though.
Note: We are using Ionic as the backbone of an website MVP, which will later be refined for an app launch, hence the focus on the path locationStrategy
Knowing this wont be fixed in v3, would it work for you all to use ? and GET queryparameters to mimic deeplinking instead of hash? Possibly works better with SEO and redirection