Drupal is installed in folder /drupal
I want the website to display on url http://domain.com and not http://domain.com/drupal
I have tried various suggestions from over the internet as well as the drupal documentation I found on this (6-8 years old) to change both .htaccess in the root directory as well as change the $base_url variable in default/settings.php
The latter action messes up the website (so I commented out the base_url again).
Whatever I change in my .htaccess file, I keep seeing http://domain.com/drupal
The only thing I accomplished is that http://domain.com takes the visitor to http://domain.com/drupal
Options +FollowSymlinks
RewriteEngine on
#invisibly redirect to subfolder /drupal
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ drupal
#leave out 'www'
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=302,NC,L]
I would be delighted if anyone can point me out how to indeed redirect without the subfolder showing up in the url.
Comments
I solved it by using:
I solved it by using:
Notice that I also changed sites/default/settings.php.
Please note that I noticed today that I lost admin access. I am not yet sure if it is related.
remaining problems solved
For my solution to the admin panel problems, please see https://www.drupal.org/node/2471929
Thanks worked for me on Drupal 8
Thanks Johan it worked for me with Drupal 8 after struggling through many other solutions elsewhere that were not working. I have a subdomain set pointing to the /drupal directory and use that sub-domain to access my admin panel.
Images issue
I used this method it's working but now I am not able to see all the images on my site.
Check your settings.php and .htaccess
For most of my installs, I have Drupal running from subfolders. Here is what I do:
settings.php
Uncomment and modify this line:
# $base_url = 'http://www.example.com'; // NO trailing slash!
.htaccess (in your subfolder)
Unless there are server/web host-specific items to add, this can be left alone
.htaccss (in Web root)
Hope this helps.
Thanks, it works perfectly.
Thanks, it works perfectly.