Sublime Forum

SideBarEnhancements Project URL not working?

#1

Hi,
I followed a tutsplus guide on getting started with ST2 and one of the points made was being able to launch a file via the actual server url (http), rather than the file directory (file://), straight from ST2 so php scripts and such will work.

The method taught (the old ‘way’ i beleive) was to add:

"url" : "http://urlhere" 

to the top of the ST2 project file, however this hasn’t worked, so i did some looking and found this thread here: "url" variable in sublime-project file to open in browser

It says the method changed, and now I’m supposed to go to Project>Edit preview URLS (after right clicking a file on the sidebar) and enter the following:

{ "/C/Users/dev/Documents/My Web Sites/Regular Dev/AdvancedWebDevelopmentPractical" : { "url_testing": "http://localhost:24630/AdvancedWebDevelopmentPractical/", "url_production": "http://localhost:24630/AdvancedWebDevelopmentPractical/" } }

I added that, and it still wants to open the browser to the directory location of the file, rather than the server URL (in other words it still opens the file via the file:// path, rather than http://)

I can only imagine i interpreted the instructions incorrectly, though i don’t know what else to do now. My only thought is that they didn’t specify what is suppose to be contained in the directory prior to the listed urls, and i could have this wrong.

Can anyone spot anything wrong with that code. It’s the exact code I’ve entered into the SidebarEnhancements.json file.
Note that my F12 hotkey won’t launch anything at all (suppose to trigger the url_testing), however alt+F12 works as well as ctrl+o (which was a hotkey used in the tutorial i was following).

Be great if someone has an idea.
Thanks.

0 Likes

#2

I followed the same guide as TC with the same result.
My project settings looks like this:
{
“url”: “http://localhost:8888/mySite/”,
“url_production”: “http://www.mySite.com/”,
“folders”:

	{
		"path": "/Users/me/mySites/mySite"
	}
]

}

0 Likes

#3

Hello

[quote]{
“/C/Users/dev/Documents/My Web Sites/Regular Dev/AdvancedWebDevelopmentPractical” :
{
“url_testing”: “http://localhost:24630/AdvancedWebDevelopmentPractical/”,
“url_production”: “http://localhost:24630/AdvancedWebDevelopmentPractical/
}
}

I added that, and it still wants to open the browser to the directory location of the file, rather than the server URL (in other words it still opens the file via the file:// path, rather than http://)[/quote]

Instead of

/C/…

Use

C:/…

Regards

0 Likes

#4

[quote=“tito”]Hello

[quote]{
“/C/Users/dev/Documents/My Web Sites/Regular Dev/AdvancedWebDevelopmentPractical” :
{
“url_testing”: “http://localhost:24630/AdvancedWebDevelopmentPractical/”,
“url_production”: “http://localhost:24630/AdvancedWebDevelopmentPractical/
}
}

I added that, and it still wants to open the browser to the directory location of the file, rather than the server URL (in other words it still opens the file via the file:// path, rather than http://)[/quote]

Instead of

/C/…

Use

C:/…

Regards[/quote]

That fixed it!
Thanks for your help, for some reason ST2 wanted to keep the file directories as “/C/…” rather than “C:/”.
Interestingly the project will show up file if the directory starts with either, however the browser will only launch the file correctly @ http:// if its the latter. Maybe a bug or unintended operation of ST2 / the plugin, given its pickiness. Eitherway its fixed. Thanks again kind sir.

0 Likes