How to use www in url

A search engine like Google,yahoo,bing would see anvar.in and www.anvar.in as essentially two separate websites. They recommend you pick one version and you can setup it with the help of htaccess
Code in the anvar.in domain’s .htaccess file:

RewriteEngine on
 RewriteCond %{HTTP_HOST} ^xyz.com [NC]
 RewriteRule ^(.*)$ http://www.xyz.com/$1 [L,R=301,NC]

How to redirect website to another url via .htaccess

Redirect individual website address to another one
To redirect individual files, like anvar.in/about.html to about-me.html you can use a 301 redirect like this:

Redirect 301 /about.html /about-me.html

To redirect one specific file to another domain such as anvar.in/oldurl.htm to anvar.in/newurl.htm:

Redirect 301 /oldurl.htm http://anvar.in/newurl.htm

Redirect an old domain to a new domain
If you had an old domain name such as anvar.com, and now you decided you actually want to use new domain anvar.in for the website. You could setup a 301 redirect for the entire domain, so that old links to anvar.com carry over.
Code in the anvar.com domain’s .htaccess file:

RewriteEngine on
 RewriteCond %{HTTP_HOST} ^xyz.com [NC,OR]
 RewriteCond %{HTTP_HOST} ^www.anvar.com [NC]
 RewriteRule ^(.*)$ http://anvar.in/$1 [L,R=301,NC]

Force to use www. in domain
A search engine like Google,yahoo,bing would see anvar.in and www.anvar.in as essentially two separate websites. They recommend you pick one version
Code in the anvar.in domain’s .htaccess file:

RewriteEngine on
 RewriteCond %{HTTP_HOST} ^anvar.in [NC]
 RewriteRule ^(.*)$ http://www.anvar.in/$1 [L,R=301,NC]

How to make a responsive youtube iframe video

To scale a YouTube video to fit any browser or tablet/mobile device for responsive design you can use either a CSS or Javascript solution to accomplish the goal.
This example uses a CSS solution, you need to add a couple of CSS styles in your main CSS file.
Here is what a typical YouTube embed code looks like, with fixed width and height:

<iframe width="560" height="315" src="https://www.youtube.com/embed/39d3LKeLfHQ"
 frameborder="0" allowfullscreen></iframe>

It would be nice if we could just give it a 100% width, but it won’t work as the height remains fixed. What you need to do is wrap it in a container like so (note the class names and removal of the width and height):

<div class="container">
 <iframe src="https://www.youtube.com/embed/39d3LKeLfHQ"
 frameborder="0" allowfullscreen class="video"></iframe>
 </div>

And use the following CSS:

.container {
 position: relative;
 width: 100%;
 height: 0;
 padding-bottom: 56.25%;
 }
 .video {
 position: absolute;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 }

How this works: The container element is given a zero height and a percentage bottom padding. The percentage bottom padding is a percentage of the container width, so that gives it a fixed aspect ratio. But in order to get the iframe to show up inside the zero-height container, you need to make the container relative and the iframe absolute, positioned inside the div.