title: .htaccess and reverse proxy not redirecting correctly
body: <p>I have a website which consists in 2 sections (each on separate server): main site and a blog part.</p>
  
  <p>I have successfully managed to configure reverse proxy and the blog section to be placed under <a href="https://example.com/blog" rel="nofollow">https://example.com/blog</a>, but not all addresses are redirected correctly at it should.</p>
  
  <p>Right now, I have correctly redirected the following urls:</p>
  
  <p>http{s}://www.domain to https: //domain/
  http{s}://blog.domain to https:// domain/blog</p>
  
  <p>The issue is that if I will enter an URL like https:// domain/blog/an-article the redirection fails (the URL is not rewritten). Also, it fails for an URL like <a href="https://www">https://www</a>. domain/blog/////an-article.</p>
  
  <p>My .htaccess files are:
  Main site .htaccess:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
      RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
      RewriteCond %{HTTPS} !=on
      RewriteRule ^/?(.*) https://example.com/$1 [L,R=301]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Blog .htaccess:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt; 
  RewriteEngine On 
  RewriteBase /blog/ 
  RewriteRule ^index\.php$ - [L] 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Happy to give you more details if required.
  Thank you!</p>