# React Router URLs (Learning React)

**URL:** https://forum.kirupa.com/t/react-router-urls-learning-react/639247
**Category:** programming
**Created:** [January 9, 2019, 12:14am UTC](https://forum.kirupa.com/t/react-router-urls-learning-react/639247 "2019-01-09T00:14:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jamesallan626](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jamesallan626/32/9416_2.png) [@jamesallan626](https://forum.kirupa.com/u/jamesallan626)
#### Post date: [January 9, 2019, 12:14am UTC](https://forum.kirupa.com/t/react-router-urls-learning-react/639247/1 "2019-01-09T00:14:13Z")

</div>

Quick question about React Router and urls from the book “Learning React”. When I code the demo, the urls that the router produces are shown below:  
[https://jamesallan626.gitlab.io/reactspa/#/](https://jamesallan626.gitlab.io/reactspa/#/) . (Home ‘page’)  
[https://jamesallan626.gitlab.io/reactspa/#/packages](https://jamesallan626.gitlab.io/reactspa/#/packages) (Packages ‘page’)  
[https://jamesallan626.gitlab.io/reactspa/#/contact](https://jamesallan626.gitlab.io/reactspa/#/contact) (Contact ‘page’)  
These are odd looking especially with the ‘#’ character.  
My question is can we do better? (ie. can get get rid of the # and make the urls more friendly?)

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [January 9, 2019, 12:27am UTC](https://forum.kirupa.com/t/react-router-urls-learning-react/639247/2 "2019-01-09T00:27:30Z")

</div>

You can set your history to use `browserHistory`. I think by default it uses `hashHistory` which includes the hash (`#`) in the url. Using the browser’s history API allows the URL to change without using the hash (and not causing the page to reload).

[https://github.com/ReactTraining/react-router/blob/v3/docs/API.md#router](https://github.com/ReactTraining/react-router/blob/v3/docs/API.md#router)
