Bookmark for switching URL

15 April 2019 devsysadminTechnology
Share with:

When developing multiple similar sites, I often stumble upon the case, when I want to open a specific link on different domain. Sometimes the same site/URL on local, staging, testing, production environments. Creating specific bookmarks to open the specific links is a bit of an overkill. Typing the same URL on the different environments is annoying. And time consuming.
So after some frustration, some googling I found a really crude javascript solution. And after sharing my “brilliant” find with my colleagues, it got quite optimized and we came with the following solution.
So, in order to open /user/logs on the URL you’ve currently opened – create a new bookmark, and in the URL section paste the following

javascript:location="/user/logs"

The link in the quotes can be anything. So this way, if you’ve opened example.com in your browser – when you click on the bookmark – it will redirect you to example.com/user/logs. Same will apply for any domain, you’ve opened in the browser. Enjoy!