Drupal8 : unable to remove "/web" from my URLs

During all the project, I kept the “/web” on my dev environment, thinking it was a simple task to remove it when delivering it… Here I am now 🙂

My URL website is : https://<a_classic_url>.org/

When going to this URL, I am automatically redirected to https://<a_classic_url>.org/web/

To change that, I tried to modify my Apache default-ssl.conf :

<IfModule mod_ssl.c> 
    <VirtualHost _default_:443> 
        ServerAdmin [email protected] 
        DocumentRoot /var/www/html 

        ErrorLog ${APACHE_LOG_DIR}/error.log 
        CustomLog ${APACHE_LOG_DIR}/access.log combined 

        # SSL Engine Switch: 
        # Enable/Disable SSL for this virtual host. 
        SSLEngine on 

        ...

To change DocumentRoot to /var/www/html/web

If I do that, redirection is going well but I loose ALL the style on my pages. After checking, the HTML/head is empty : no CSS, no JS, …

It looks like nothing from the theme is loaded. But the twig template is used.

Here is my theme : web/themes/custom/mytheme (based on bootstrap). And my mytheme.info.yml seems to be classic :

core: 8.x
type: theme
base theme: bootstrap

name: 'mytheme'
description: 'Uses the jsDelivr CDN for all CSS and JavaScript. No source files or compiling is necessary and is recommended for simple sites or beginners.'
package: 'Bootstrap'

regions:
  navigation: 'Navigation'
  navigation_collapsible: 'Navigation (Collapsible)'
  header: 'Top Bar'
  header_home: 'Header home'
  menu_home: 'Menu home'
  search_home: 'Search home'
  highlighted: 'Highlighted'
  help: 'Help'
  content: 'Content'
  sidebar_first: 'Primary'
  sidebar_second: 'Secondary'
  footer: 'Footer'
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  footer_left: 'Footer left'
  footer_right: 'Footer right'

libraries:
  - 'mytheme/global-styling'

My mytheme.libraries.yml too :

global-styling:
  css:
    theme:
      css/style.css: {}

  js:
      js/main.js: {}
      dependencies:
        - core/assets/vendor/jquery

After looking at the code, I found a .htaccess in the root directory :

RewriteEngine on
RewriteRule ^$ /web/ [L,R=301]

So, it looks like it was an intended behavior… But I don’t want /web in my URLs…

Every idea or link or information will be greatly appreciated !

Thanks.

INFORMATION

– Drupal 8.4.2

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed