Page 1 of 1

How to remove # from the URL routes?

Posted: 24 May 2022, 06:19
by thebr
Hello, I have recently bought this template using my company account, but when using this template, I came across a small issue that is bothering me.
The routes always seem to add

Code: Select all

#
after the

Code: Select all

/
For example, the homepage is

Code: Select all

localhost:3000/#
And because of that, if I have to go to any of my routes, such as Settings, it is always

Code: Select all

localhost:3000/#/settings
When I manually enter the URL

Code: Select all

localhost:3000/settings
, it does not recognize the route and proceeds to show the home component because there is a missing

Code: Select all

#
in the URL.
When I enter a URL that does not match any path, I would expect it to show the invalid page component which is already available in the template, please help me with how I can implement the same and also solve this URL issue.

Thanks.

Re: How to remove # from the URL routes?

Posted: 25 May 2022, 12:19
by mert.sincan
Hi,

All Layouts use React Router in Create React App project. You can update the router according to your needs. For your case, please review;
https://stackoverflow.com/questions/351 ... act-router
https://reactrouter.com/docs/en/v6

Best Regards,