Conflicting multiple redirect rules in htaccess
<p>I want to redirect the site ip to my site <code>https</code> as well as i want to redirect the non-www urls to <code>www</code> urls. i have written these two rules but they are conflicting. Here is my cade : </p>

<pre><code># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

#Redirect ip to site
RewriteCond %{HTTP_HOST} ^xx\.xx\.xxx\.xxx$
RewriteRule ^(.*)$ https://www.domain.pk/$1 [L,R=301]

#Redirect non-www to www
RewriteCond %{HTTPS_HOST} !^www\.
RewriteRule ^(.*)$ https://www.domain.pk/$1 [R=301,L]

&lt;/IfModule&gt;

# END WordPress
</code></pre>