.htaccess redirect from olddomain to newdomain

A friend of mine wanted to redirect an old domain to a new doman, he made a simple 301 redirect but as the server physical ip was the same he falled into an redirect loop between domains.

What he needed to fix that is an if condition in the rewrite rule, I made this snipplet for him.

RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

Webkit custom scrollbar iOs style

I wanted to reproduce the look and feel of the ios scrollbar, so I played with the
::-webkit-scrollbar property.

Check out the demo, here

Here the code:

::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
height: 30px;
display: block;
background-color: transparent;
}
::-webkit-scrollbar-track-piece {
background-color: #E9E9E9;
-webkit-border-radius: 6px;
}
::-webkit-scrollbar-thumb:vertical {
height: 50px;
background-color: #999;
border: 1px solid #eee;
-webkit-border-radius: 6px;
}

Tip: Fix random zoom on ipad orientation change

If you have the width set in the viewport :

<meta name = "viewport" content = "width=device-width; initial-scale=1.0;
 maximum-scale=1.0;"
/>

And then change the orientation it will randomly zoom in sometimes (especially if you are dragging on the screen) to fix this don’t set a width here I used :

<meta id="viewport" name="viewport" content="initial-scale=1.0; user-scalable=0;
minimum-scale=1.0; maximum-scale=1.0"
/>

This fixes the zoom whatever happens then you can use either window.onorientationchange event or if you want it to be platform independant (handy for testing) the window.innerWidth method.