# \[JS\] alter URL with redirection

**URL:** <https://forum.kirupa.com/t/js-alter-url-with-redirection/243312>\
**Category:** web dev\
**Created:** [November 5, 2007, 6:57pm UTC](https://forum.kirupa.com/t/js-alter-url-with-redirection/243312 "2007-11-05T18:57:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bardic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bardic/32/3708_2.png) [@bardic](https://forum.kirupa.com/u/bardic)\
**Post date:** [November 5, 2007, 6:57pm UTC](https://forum.kirupa.com/t/js-alter-url-with-redirection/243312/1 "2007-11-05T18:57:32Z")

</div>

As the title says, I want to alter the url with javascript with redirecting the user. So say that I have index.php?id=2 I want to alter it on pageload to just say index.php …

Any idea’s now how to do this or a link to a guide that would explain how to do it?

Thanks
