Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Created December 19, 2016 02:37
Show Gist options
  • Save henrytran9x/ae6a92d2d78edc7b5244f944b88576b8 to your computer and use it in GitHub Desktop.
Save henrytran9x/ae6a92d2d78edc7b5244f944b88576b8 to your computer and use it in GitHub Desktop.
*SOLVED* Drupal installed in subfolder, want url without subfolder Drupal
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)
Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.[yourdomain]\.[your TLD]$ [NC]
RewriteRule .* http://www..[yourdomain].[your TLD]/ [L,R=301]
RewriteRule ^$ production/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/[subfolder]%{REQUEST_URI} -f
RewriteRule .* [subfolder]/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*[subfolder]/index.php?q=$0 [QSA]
Hope this helps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment