It's not possible to change or freeze a device orientation from web-browser, without an external helper application. The whole idea of locking device seems having a need to be reconsidered and redisigned. Here is one of the menthods you can use.
I think this is not a device orientation what is important to your site, but a landscape design in its content. For this requirements you should place your entire site content into a container, which must be always scaled to fill browser window (width:100%
) and maintain its height in required aspect ratio to the width.
In landscape's device orientation your site will operate as usual. In the portrait mode, the content will be displayed scaled down to current width, with black regions in top and bottom of browser's window (much like when you view 16:9 movie on 4:3 screen), if you align the container vertically.
If you can afford your content to be aligned at a top of window (with larger black region beneath), you can delegate entire process of the scaling to the browser itself by specifing meta viewport:
<meta name="viewport" content="width=device-width">
If it doesn't suit your needs, it would be helpful if you provide more info about the site specifics.