Installing in a sub-folder of Angular I have an Angular 2+ application running. I would like to install Drupal in a subfolder and have my Angular application to iframe the contents.

Ideal Folder Structure:  

/             - Angular  
/content      - Drupal  


I have an existing rewrite rule to rewrite all URLs to index.html. Drupal works fine with pages like http://myapp.com/content/admin, but if I am accessing a page like http://myapp.com/en/page, it will be redirected to the index.html file of the Angular application.  

How do I configure Drupal to make it add /content to its URLs?

I am hosting them on IIS. These are the rewrite rules I have now.

&lt;rewrite&gt;
  &lt;rules&gt;
    &lt;clear /&gt;
    &lt;rule name="HTTPS Redirection" stopProcessing="true"&gt;
      &lt;match url="(.*)" /&gt;
      &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
        &lt;add input="{HTTPS}" pattern="^OFF$" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" /&gt;
    &lt;/rule&gt;
    &lt;rule name="Angular Routes" stopProcessing="true"&gt;
      &lt;match url=".*" /&gt;
      &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
        &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
        &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Rewrite" url="./index.html" /&gt;
    &lt;/rule&gt;
  &lt;/rules&gt;
&lt;/rewrite&gt;
Finally got it working, the following are the changes I've made. I am writing this here in case anyone faces the same problem.


I noticed there was another web.config file in root of Drupal folder (/content) and it contains a few rewrite rules.
I've changed the last rewrite rule which rewrite all requests to index.php, it now looks like this:


&lt;!-- Pass all requests not referring directly to files in the filesystem to index.php. --&gt;
&lt;rule name="Short URLS" stopProcessing="true"&gt;
  &lt;match url="^(.*)$" ignoreCase="false" /&gt;
  &lt;conditions&gt;
    &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /&gt;
    &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /&gt;
    &lt;add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Rewrite" url="/content/index.php" /&gt; &lt;!-- CHANGES IN THIS LINE, ADDED '/content'/ in front of index.php --&gt;
&lt;/rule&gt;        



Modified .htaccess file in root of Drupal folder and added this line RewriteBase /content, below this line # RewriteBase /
Modified the web.config file in root folder of Angular App (/) to the following: 


&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;configuration&gt;
  &lt;!-- Install IIS url rewrite module. --&gt;
  &lt;system.webServer&gt;
    &lt;rewrite&gt;
      &lt;rules&gt;
        &lt;clear /&gt;
        &lt;rule name="Angular Routes" stopProcessing="true"&gt;
          &lt;match url="(.*)" negate="false" /&gt;
          &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
                        &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
                        &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
                        &lt;add input="{URL}" pattern="^/content/(.*)$" negate="true" /&gt;
          &lt;/conditions&gt;
          &lt;action type="Rewrite" url="./index.html" /&gt;
        &lt;/rule&gt;
      &lt;/rules&gt;
    &lt;/rewrite&gt;
  &lt;/system.webServer&gt;

&lt;/configuration&gt;