0

The url of this page appears to be stackoverflow.com/questions/ask, but when you copy-paste it, it becomes http://stackoverflow.com/questions/ask. How can I change the appearance of my page's url in this behaviour?.

Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239
  • The URL of that page is `http://stackoverflow.com/questions/ask`. Some browsers choose not to display the `http://`. You cannot change this. – Dark Falcon Nov 23 '15 at 19:10
  • 1
    This is browser behavior, which hides `http://`. – Ultimater Nov 23 '15 at 19:10
  • 2
    Possible duplicate of [Modify the URL without reloading the page](http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) – Bardicer Nov 23 '15 at 19:11
  • This question is not: http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page – Charlie Nov 23 '15 at 19:14
  • If you rewrote the question to be interested in the part AFTER the domain, I could give you an answer involving `history.pushState` but since you didn't, I'm not gonna post an answer to this question if it's not asked properly. – Ultimater Nov 23 '15 at 19:18
  • I'm going to have to agree with `@Ultimater`, this is browser behavior, which sadly, you cannot alter or change. However, if you have anything after your domain name such as: `example.com/folder/I-am-a-file.php`, you can manipulate whatever you have after your domain name: `folder/I-am-a-file.php`. You are just unable to change the browsers behavior when it comes to your question. If you get a SSL cert, your URL will inlucde: https:// which, I'm pretty sure isn't hidden. – This Guy Nov 23 '15 at 19:23
  • 1
    Is it the `http://` part you want to make change “appearance” of or is it the `domain/path?qs` part? – Asons Nov 23 '15 at 19:26
  • 1
    @Ultimater If s/he rewrites the question and state s/he mean the "domain/path" part, it becomes a _duplicate of http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page_ and you should vote to close accordingly. – Asons Nov 23 '15 at 19:29
  • It is not rocket science to understand that the difference in his samples is "http". Please don't push him to ask something else which you have a ready made answer. – Charlie Nov 24 '15 at 05:54

2 Answers2

0

The appearance of the URL is done solely by the browser, not by the website. Even an illustrious website like stackoverflow.com doesn't control that. I don't know of any API available to a script to do it, and I don't expect there ever will be one. How the URL appears in the address bar is an important security feature for users, so the browser developers aren't going to just open it up to scripts.

You can get a special SSL certificate for your site that causes the browser to show your company name before the URL, but you have to buy that, and there are several conditions you have to meet.

Chad
  • 693
  • 5
  • 17
0

Its only the browser that hides the http:// part.

The actual url is http://stackoverflow.com/questions/ask

It shows full url when it is https

enter image description here

Charlie
  • 22,886
  • 11
  • 59
  • 90