Re: Azure static websites
Just a thought - have you tried the tag? Create a https://www.w3schools.com/tags/tag_base.asp Don't think I've ever used it, but it hopefully will override that behaviour. Cheers, Chris On 19 July 2018 at 09:22, Greg Keogh wrote: > Folks, I was surprised to find that one storage account == one static > website by creating one special $web container. I was sort of expecting > that containers could be published as distinct websites. So to publish 4 > static web sites I have to create 4 storage accounts, which is a nuisance. > > I thought I could squeeze multiple sites into one $web container by using > pseudo-folders, like this: > > https://foobar.z26.web.core.windows.net/site1 > https://foobar.z26.web.core.windows.net/site2 > --etc-- > > However, if you upload complete static websites into these folders then > the relative links to css files and other pages break. Simple relative > links like href="page2.htm" seem to jump up a level to the root and you get > 404. Same for links to css files. So there's some mixup about where > "relative" links point to from inside a folder. Damn nuisance. > > *Greg K* >
Re: Azure static websites
@Greg, I've not trialled creating a web-site from a storage account yet. But you might be able to stand-up Azure Function Proxies to create the distinct web-sites you're after. On Thu, 19 Jul 2018 at 07:22, Greg Keogh wrote: > Folks, I was surprised to find that one storage account == one static > website by creating one special $web container. I was sort of expecting > that containers could be published as distinct websites. So to publish 4 > static web sites I have to create 4 storage accounts, which is a nuisance. > > I thought I could squeeze multiple sites into one $web container by using > pseudo-folders, like this: > > https://foobar.z26.web.core.windows.net/site1 > https://foobar.z26.web.core.windows.net/site2 > --etc-- > > However, if you upload complete static websites into these folders then > the relative links to css files and other pages break. Simple relative > links like href="page2.htm" seem to jump up a level to the root and you get > 404. Same for links to css files. So there's some mixup about where > "relative" links point to from inside a folder. Damn nuisance. > > *Greg K* >
Re: Azure static websites
Chaps, after digging into the documentation some more and running some experiments, I can see that hosting multiple websites and domains in a single storage account is not possible. I didn't notice for a while that there is a Storage Account > Custom Domain setting in the portal where you enter the domain name being assigned to the $web container. I forgot to set this and kept getting a mysterious 500 BadUri error. This setting therefore forces you to assign one domain to each $web container in each storage account. So be it ... but it looks clumsy to have 5 fully-featured storage accounts defined just to hold 5 small static websites. At least they're dirt cheap. *Greg K* >