Thanks for the quick reply. Perhaps I should have phrased it better, but good news is I half way solved the issue and have a custom url but it has it’s issues. One site per port and can’t figure how to remove the port without crashing with ERR_CONNECTION_REFUSED. I also think I opted for the long Frankenstein route so have listed my method in case there is a better way.
I have an install called Website A type hugo server and it used localhost:1313 which is the default url.
It is under /www/websitea/www_root/
I then installed another copy of Hugo for a separate site, Website B. However it uses localhost:1313 on the front end too after using hugo server to make it work.
It is under /www/websiteb/www_root/
So what I would require is a means to say in the config of Website A baseurl=“http://websitea.localhost” and in Website B baseurl=“http://websiteb.localhost”.
Otherwise I have only localhost:1313 to use which would only show Website A.
So goal would be to type Hugo server and have the two accessible in the browser as simply http://websitea.localhost and http://websiteb.localhost.
Neither Website A or Website B are related so I want them totally stand alone ie if I ever delete Website A it would never effect Website B. From what I can see, Multisite workflow wouldn’t work in this case as it implies only one can work at a time by targeting configs (But, I may most likely have this wrong).
I attempted
hugo server --watch --baseUrl=http://websitea.localhost/ --port=1313 --appendPort=false
And got websitea.localhost:1313 to show the homepage, however sub pages don’t instantly work as I need to place in the port :1313 in the url to view them.
When I attempted the same again whilst in the Website B folder
hugo server --watch --baseUrl=http://websiteb.localhost/ --port=1313 --appendPort=false
websiteb.localhost:1313 shows the content of the Website A.
This implies that localhost:1313 and *:1313 is actually Website A and websitea.localhost:1313 is just a mirror of this. The downside being that any other Hugo site on the port 1313 will mirror Website A. So one port per site.
So I attempted with hugo server --watch --baseUrl=http://websiteb.localhost/ --port=52643 --appendPort=false
websiteb.localhost:52643 shows the Website B content which is correct.
Also a downside of this is typing hugo sever in terminal to start up is it will possibly wipe the custom url so each time I restart I will need to type other the full commands above.
Now I need to remove ports and still have the sites running as the url paths require the ports for the subpages and css to be present at the moment, something which they are not and shouldn’t be.
From what I can see through testing is that the themes used affect the port, creating a variant port (:52643, :51897, :51713) which in most use cases is fine but if two sites use the same theme their port may match causing the the mirror issue. I may be wrong and it is purely random on creation and it may have been coincidental for just me.
Regards
C