How to remove the project name from URL when debugging

This should be pretty simple.

My website references all it's URLs for stylesheets, scripts and links at the root of the domain.  For instance, a stylesheet looks like this...

/assets/styles/default.css

The problem is that when debugging in PhpStorm, it uses a URL like this:

http://localhost:63342/onsongapp.com/index.php

Which breaks all the links.  I need it to look like this:

http://localhost:63342/index.php

Why would the debugger add that project name? It should just use a different port for different projects.  I need to know how to remove the project name from the URL or PhpStorm is basically useless to me.

1 comment

Hi there,

>Why would the debugger add that project name?

You are using PhpStorm's own built-in simple web server. It requires project name in URL to identify the project (similar like domain name is used by proper Apache/nginx/IIS etc)

You may by-pass it by moving it into the domain name part and by editing the hosts file (or local DNS server). See https://stackoverflow.com/a/24908091/783119

Alternatively -- just use proper web server (e.g. Apache from some stuck like WAMP/XAMPP/etc)

>It should just use a different port for different projects.

Built-in web server uses one port only.

If you wish to use multiple ports -- use another/proper web server

 

NOTE: if no Deployment entry is configured (and marked as Default) .. then built-in web server is used when generating URL for current file.

1

Please sign in to leave a comment.