title: Htaccess Redirects - Combine many rules in one single redirect
body: <p>I am trying to combine more rules in a single redirect, right now I have many rules and many redirects, like in the picture attached, but for SEO purpose this is not a good behavior.</p>
  
  <p><a href="https://i.stack.imgur.com/5iVvi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5iVvi.png" alt="enter image description here"></a></p>
  
  <p>The story is this: I have an old url, which doesn't exist anymore and a new one, where I want to be redirected. If the requested url doesn't have www. and https then I want to add them.Also if the url has an slash at the end, I want to remove it.
  All is working right now, but in many steps.</p>
  
  <p>This is what I have in my .htaccess file:</p>
  
  <h3>301 redirect from old url to the new one with www.</h3>
  
  <pre><code>RewriteRule ^source1/source2$ https://www.domain.com/destination1/destination2 [L,R=301]
  </code></pre>
  
  <h3>Remove the slash from the end of URL</h3>
  
  <pre><code>RewriteCond %{REQUEST_URI} !^/system [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.+)/$ /$1 [R=301,L,QSA]
  </code></pre>
  
  <h3>Redirect to https</h3>
  
  <pre><code>#-----------------redirect to https-----------------
  RewriteCond %{HTTPS} !on [OR]
  RewriteCond %{HTTP_HOST} !^www.domain.com(.*)$ [NC]
  RewriteRule (.*) https://www.domain.com%{REQUEST_URI} [L,R=301]
  </code></pre>
  
  <p>I use all of these rules inside this directive: </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  </code></pre>