Project name not included in loading resources path when viewing app locally

I have two projects recently downloaded and installed in PHPStorm, both already working on a remote server.

One project will not view locally in browser from PHPStorm. The other is OK.

My local resources are not being loaded e.g. file js/app.js in projects golfTOCS and spanishpointscup -
1) Working project, Request URL: http://localhost:63342/golfTOCS/js/app.js
2) Not working, Request URL: http://localhost:63342/js/apps.js, but should be http://localhost:63342/spanishpointscup/js/app.js

Latter project loads index.html correctly and all externally sourced files, e.g. bootstrap, angularjs, ... - http://localhost:63342/spanishpointscup/,
but no other local files are loaded.

Thanks for any assistance.


Comment actions Permalink

Seems like this was casued by <base> tag in my index.html, so now the app starts to load.
Onto php-cgi not found now.

Comment actions Permalink

You can convert your http://localhost:63342/golfTOCS/js/app.js kind of URLs into more convenient http://golfTOCS:63342/js/app.js -- this will allow you to keep the <base> tags.

For this you will have to:
1) Add record for "golfTOCS" which points to your local IP in your "hosts" file or local DNS server (if you have one).
2) Configure and use Deployment entry ("In Place" type should be just fine) -- write that URL there and mark such entry as Default for this project -- now IDE will use that URL to open files in browser

Comment actions Permalink

Thanks Andriy. I am able to load both my apps locally now and retain the base tags.
Took me a while to figure out how to edit/save hosts file correctly, but once I stop saving it as .txt, then all was good.

Cheers - Larry


Please sign in to leave a comment.