Sublime Forum

Using Html--> my browser is showing file:// and not https://

#1

it’s showing in file:// whenever i test my code but i want it in https://
I found this resource to help me out but it didn/t work probably because i didnt fill up the code right


They gave this example of code to insert
{

"/Users/thoriq/Sites/project" : {

"url_testing" : "http://localhost/project" ,

"url_production" : "http://www.project.com"

}

}

and i wrote

{
“Users/Bonni/OneDrive/Bureau/firstsite”: {

"http://localhost:3000/", 
"url_production":"http://www.firstsite.com"

}
}

what/s wrong? Thank you in advance!

0 Likes

#2

I guess you tried to run Open file in Browser for the html file open in ST?

This command just opens the file with the default associated programm. Hence the browser will directly open the html file and shows file:// in the URL.

To see an https:// you’d need to setup a local http server with SSL support or any kind of development server (in case you work with ReactJS or something like that).

Then just navigate to that server via browser and refresh the content once you have changed your html source, which is delivered by the http server then.

0 Likes

#3

Try using http-server in the npm project.

By default it will use HTTP:// and not HTTPS:// but if you really need that S they have instructions for that here: https://www.npmjs.com/package/http-server#need-a-self-signed-ssl-certificate

0 Likes

#4

hello, thank you a lot both of you for your help. I am new at this so the software are not obvious. I have now succesfully the http -server with the help of the website and i can now see my website when i browse online for local host. However when i try to open my index.html file with chrome or view in browser from sublime text it still gives me a file format.

0 Likes

#5

also @Deathaxe you’ve mentioneed i shouldn’t “View in Browser” but what else should I use to view my code in that case. Maybe that’s why http:// is still not appearing

0 Likes

#6

Maybe Open in Browser?

0 Likes

#7

I use bookmarks in my browser for this sort of stuff.

0 Likes

#8

You probably want to fix your settings file syntax:

{
  "Users/Bonni/OneDrive/Bureau/firstsite": {
    "url_testing": "http://localhost:8080/", 
    "url_production": "http://www.firstsite.com"
  }
}

The link you sent explains how to open your files using shortcuts. Please read it thoroughly.

Once you’ve uploaded your site to a domain, I’d recommend looking up “WinSCP” (assuming you’re using Windows). It’s a program that allows for continuous uploading every time you change a file using the “keepuptodate” command.

0 Likes