title: Drupal redirect to web folder
body: <p>I'm trying to configure redirects on a drupal site using apache web server. I'm trying to implement this <a href="https://www.symphonythemes.com/drupal-blog/remove-web-part-composer-based-drupal-site" rel="nofollow noreferrer">https://www.symphonythemes.com/drupal-blog/remove-web-part-composer-based-drupal-site</a> but I cannot seem to get it working. I have several drupal sites running in <code>/var/www/html/drupal</code>. My drupal configuration in my httpd.conf files are</p>
  <pre><code>- name: create drupal httpd conf
      copy:
        content: |
                 &lt;VirtualHost *:80&gt;
                   ServerName qsd
                   DocumentRoot /var/www/html/drupal
                   &lt;Directory /&gt;
                      Options FollowSymlinks
                      AllowOverride All
                   &lt;/Directory&gt;
                 &lt;/VirtualHost&gt;
        dest: /etc/httpd/conf.d/drupal.conf
  </code></pre>
  <p>and</p>
  <pre><code>- name: allow override /var/www/html
      copy:
        content: |
                  &lt;Directory &quot;/var/www/html&quot;&gt;
                    Options Indexes FollowSymLinks
                    AllowOverride All
                    Require all granted
                  &lt;/Directory&gt;
        dest: /etc/httpd/conf.d/app.conf
  </code></pre>
  <p>I've added</p>
  <pre><code>if ( isset($GLOBALS['request']) &amp;&amp; '/web/index.php' === $GLOBALS['request']-&gt;server-&gt;get('SCRIPT_NAME') ) {
      $GLOBALS['request']-&gt;server-&gt;set('SCRIPT_NAME', '/index.php');
  }
  </code></pre>
  <p>to my settings.php.</p>
  <p>Now I'm trying to get my <code>.htaccess</code> files correct for my drupal app which is in <code>/var/www/html/drupal/app</code>. In <code>/var/www/html/drupal/app/.htaccess</code> I have</p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  # Redirect to the subdirectory because that's where Drupal is installed
  RewriteBase /app
  RewriteRule (.*) web/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  <p>In <code>var/www/html/drupal/app/web/.htaccess</code> I have</p>
  <pre><code>RewriteBase /web
  </code></pre>
  <p>When I visit <a href="https://example.com/app" rel="nofollow noreferrer">https://example.com/app</a> I get redirected to my OIDC provider but the <code>redirect_uri</code> is missing the <code>/app</code>. And when I visit <a href="https://example.com/app/user/login" rel="nofollow noreferrer">https://example.com/app/user/login</a> I get a 404, but prior to adding <code>.htaccess</code> <a href="https://example.com/app/web/user/login" rel="nofollow noreferrer">https://example.com/app/web/user/login</a> was working. Any help would be much appreciated, thank you.</p>