I have a shared hosting account that I would like to set up a Drupal 8 website on. However, been the primary domain for the hosting account, I cannot change the hosting directory where CPanel serves-up the web content. I can install Drupal 8 in a sub-directory off the web-root, however, I would prefer the sub-directory portion not be shown in the URL (i.e. http://domain.com instead of http://domain.com/subdir). I have incorporated drupal-composer/drupal-project into my project.

Does anyone have a working .htaccess file that resolves this scenario?

  • 5
    Possible duplicate of How do I run Drupal 8 in a subdirectory?
    – user21641
    Oct 15, 2017 at 13:53
  • Answer partly resolves issue. However, now I have an issue with the admin/menu system showing the full path (not the redirected path). Obviously when clicking on those links, I get an 'access denied' error. Is there a way to get around this?
    – user189842
    Oct 15, 2017 at 15:58
  • If you want to run Drupal on www.example.com you need to install it in the root directory of your server OR point your domain to the subdirectory of your Drupal install.
    – Sam
    Oct 16, 2017 at 10:43
  • 1
    @Tom Thorp, that is a new separate question. See if it already has been asked before, and if not, ask it yourself. You can provide a link to this question for reference. Oct 25, 2017 at 18:39


Browse other questions tagged or ask your own question.