Freddy, I just put up with the fact that the path for the location of the include file is wrong.
Problem is, that the root directory for the localhost is different to the root directory of the remote host. In other words, having a link like /css/main.css will be interpreted differently on the localhost to what the intention is.
I use WAMP too. I just create subfolders for each site (which are the site roots) - eg \wamp64\www\mysite - and everything seems to work without any trouble between local and remote versions. Perhaps I’m not using WAMP as intended but it all seems to work as I want.
I don’t bother with any development environment on my local machine at all, I only use remote.
When I need a new site called something like clientsmewwebsite.com I just go and create a new account in WHM with that domain, regardless of it is is a registered domain name or not. I then use my /etc/hosts file to tell my machine what the IP Address of the server is when DNS looks for clientsnewwebsite.com
If a client wants me to re develop their existing website like lets say apple.com or something then I can do the exact same procedure as above.
This works well as once the client approves the website I have no need to make any alterations to any files at all, i just add another remote to Wappler and upload everything.
Anyway, each to their own, just saves me from setting up web servers, ftp servers, dynamic ip to hostname services so my client can access it, etc.
I do the same (except I combine this with WAMP). For a site you’re redeveloping, using the hosts file is particularly useful as it enables you to see the current version and the version you’re working on at the same time. Eg you can have website.com for one version and www.website.com for the other.
@TomD completely agree with you. I even think such a feature should be in wappler which edits your hosts file . I think its the best „workaround“,… but maybe Antivirus Apps won‘t be happy to see Wappler changing hosts file
Wappler can already do that on a mac, there is a button on the bottom right saying Terminal, hit that and type in sudo nano /etc/hostsENTER,
type your machine password ENTER
the hosts file opens in Wappler in the bottom terminal / console section, make your changes, CTRL+o initiates the save function, then ENTER to allow save over the existing file, then CTRL+x to exit the hosts file nano editor.
If you prefer you can also use sudo pico /etc/hosts whichever terminal editor you prefer.
I just tried, following the advice of others, links relative to site root with positive results. This eliminates the need for the PHP code.
Unfortunately, in my case this does not help. I tend to place a proposed site as a sub folder of an existing remote site. When I use the solution stated above, the links will use the existing site as the root folder. I’ll just stick with what I have always done which is to disregard the bad link in the included file.
@psweb I know your solution, but it would slow down my whole process, cause I have slow Internet here. @ben your solution would work, but its a quirk for me … As I’m overwriting other projects and not having clean structure then. Maybe i could just FAKE my localhost for each project.