Intellij idea opens static pages in browser with different URL formats

The Intellij idea has a nice “browser open feature” that I often use for my static html files. Any html file can be opened in a browser in two ways: 1. The idea has an internal web server that serves static content at http://localhost:63342/<relative path to content> . 2. Via file:///<absolute path> url.

After a recent update (14.0.2), the browser started opening pages as file:///<absolute path> , although the internal web server is still present, and all I need to do is edit the URL. Very annoying. I searched a lot, but still can’t understand how I can influence this behavior, so all my static pages will open in the browser as http://localhost:63342/<relative path to content>

+6
source share
1 answer

Specify the server connection settings:

In the Host text box, enter localhost. Use the Port field to specify the port number on which the embedded web server is running. The port number must be set to 1024 or higher. By default, this port is set to the default IntelliJ IDEA port through which IntelliJ IDEA accepts connections from services (63342).

Specify the folder that will be considered the root of the server document. Folders located under this document root in the project tree will be passed to the PHP interpreter. The root folder of the server document can be obtained via HTTP on the above host: node.

In the "Copy document" text box, specify the path to the corresponding folder. This can be the root of the project or any other folder under it.

References

+1
source

Source: https://habr.com/ru/post/979678/


All Articles