0

I am new to SharePoint and SPFx solutions. Recently I created an SPFx solution which is basically a react spa application which replaces the homepage of the SharePoint site. But the solution adds '#/' at the end of the main URL. Any one know why this is being added?

For example the URL I need is https://site-name but once the solution is deployed I see that the URL is https://site-name#/

Any one know how to solve this issue?

3
  • Are you facing any issue because of additional # in URL (you should not)? As you are using URL routing, your default router must be #. So, whenever, you load the SPA, it adds the the default routers (#) at the end of the site page URL. Commented Nov 21, 2022 at 5:50
  • 1
    I dont face any issue but a bit odd to see the # at the end of the url
    – Treesa
    Commented Dec 14, 2022 at 9:30
  • check link given in my answer & see if it helps you. Commented Dec 14, 2022 at 9:49

1 Answer 1

0

You are using URL routing (react routing) in your SPFx solutions and your default router must be #.

So, whenever you load the SPA, it adds the the default router (#) at the end of the site page URL.

However, you should not face any issues because of this additional # in the URL.

Check this thread if it helps you to remove # from the URL: How to stop /#/ in browser with react-router?

2
  • 1
    yes I don't face any issue with the #. Its just a bit strange and not consistent with the other sharepoint page urls
    – Treesa
    Commented Jan 4, 2023 at 5:50
  • I agree with your point but it is just because you are using custom web part with react routing. Commented Jan 4, 2023 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.