Solution for Drupal 8 users wanting to hide the drupal subdirectory and use the main domain name

Solution for Drupal 8 users wanting to hide the drupal subdirectory and use the main domain name

I spent a full 24 hours on this issue (less 8 hours of sleep). It would, of course, have been easy if I had just used a subdomain like https://drupal.gadgeteer.co.za but many sites across the Internet link to some of my pages and have long been using just the domain name http://gadgteer.co.za with the path to the correct page. The problem is that you can redirect the domain name but it then always wants to append /drupal to the URL which breaks those links. I got it to work fine with http://drupal.gadgeteer.co.za and https://www.gadgeteer.co.za but not at all with my main domain.

I learnt a lot about .htaccess files and cPanel redirects (which are actually set from the .htaccess file in the public_html directory). The short of it though is I finally found a solution that worked with Drupal 8 at https://www.drupal.org/forum/support/post-installation/2015-04-09/solved-drupal-installed-in-subfolder-want-url-without. So hopefully this helps any other poor Drupal 8 souls struggling with this

#drupal8 #redirect

16f77ecb cee4 45b1 83a7 ec2e28ab3345