Nathan J.B.
Nathan J.B.

Reputation: 10325

Is there a way to get PhpStorm/WebStorm to use a custom domain in previews?

Without any configuration, the default action when clicking on a browser icon in PhpStorm/WebStorm is to open the file in localhost:port.

Is there a way to get PhpStorm to use a custom domain? (Let's assume the domain is already setup to point to 127.0.0.1 in your /etc/hosts file.)

Launch Preview Button Localhost with port in address bar

Upvotes: 0

Views: 604

Answers (2)

duck_in_hat
duck_in_hat

Reputation: 252

You may want to configure deployment (Build, Execution, Deployment | Deployment) and specify "Web Server URL" there. In this case, "Open in browser" action will refer to this setting instead of built-in server.

More about deployment: https://www.jetbrains.com/help/phpstorm/settings-deployment.html

Upvotes: 4

LazyOne
LazyOne

Reputation: 165188

Sure, just define deployment entry and mark it as Default for this project. It will now be used instead of PhpStorm's built-in simple webserver.

Settings/Preferences | Build, Execution, Deployment | Deployment

URL from Web server root URL field will be used instead of localhost:63342.

Upvotes: 2

Related Questions