htaccess: set and use environment variables inside your htaccess

A while ago I learned how to set a variable in my .htaccess that can later on be user in PHP:

.htaccess

PHP:

Something that I could not figure out was how to use the defined variable inside the htaccess. While searching for CORS implementation, I ran across this post on stackoverflow.com:

There there is the answer to my question, how to set and get an environment variable in htaccess:

htaccess: allow access control from subdomains

When having an application running on the top domain of your site you may want to allow subdomains to make ajax requests to the top domain. If that is the case, and if you do not know which subdomain will be making the request, you should consider adding the following rule to you .htaccess file in your top domain:

Render jQuery Mobile on Desktop Computers

If you designed a jQuery Mobile site that it is intended for small size screens, that does not mean that someone will never open your app from a desktop computer. Obviously, an app that was design for an actual screen size of 320 px will not look right if it is opened on a desktop computer.

To prevent the app from looking awful, we can apply CSS to restrict the jQuery Mobile pages from rendering at a width higher that, let’s say, 480 px.

Setting Up The Default Values Of The jQueryMobile Preloader

Here is a quick example that shows how to setup the default values of the jQueryMobile preloader: