I have drupal 9.1.4 in the subdirectory “drupal9” because the site is now running from the “drupal7” directory. I have done the installation manually in minimal installation by ftp and make my own theme. Everything works fine when I access the site:
sitename.com/drupal9
Now of course I want it to run from the subfolder, without showing the subfolder name. Until now, drupal 5, drupal 6 and drupal 7 have always worked fine.
Through the information from all kinds of sites I have tried the following:
In the root in a .htaccess file:
RewriteRule ^ $ drupal9 / $ 1 (L)
RewriteCond% {REQUEST_FILENAME}! -D
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ (. *) $ Drupal9 / $ 1 (L)
In the .htaccess file of the directory drupal9 (of which I doubt if this adds anything):
RewriteBase / drupal9
And in settings.php:
if (isset ($ GLOBALS (‘request’)) and ‘/drupal9/index.php’ === $ GLOBALS (‘request’) -> server-> get (‘SCRIPT_NAME’)) {
$ GLOBALS (‘request’) -> server-> set (‘SCRIPT_NAME’, ‘/index.php’);
After adding this and running sitename.com/update.php I think it should all work.
In fact, it will then be possible to enter the drupal9 site, without the drupal9 folder being visible in the address bar.
However, at that moment I can no longer login to the admin section and subsequent menu links are no longer visible and cannot be accessed via the address bar. I have no idea how to fix this … hope someone can help me.