Skip to content

Instantly share code, notes, and snippets.

@iAugur
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save iAugur/c94b616878adf1ae4100 to your computer and use it in GitHub Desktop.

Select an option

Save iAugur/c94b616878adf1ae4100 to your computer and use it in GitHub Desktop.
Magento and Drupal in one site
This Gist is to show how to set up a document structure and VHosts file to get a magento site to work alongside a Drupal site
the original post is here: http://technology.blue-bag.com
# Pseudo / Skeleton VHosts file to illustrate how to use mod_alias to serve Drupal and Magento on one URL
<VirtualHost :80="">
ServerName www.example.com
# Set the document root to the Drupal codebase
DocumentRoot /var/www/sitefolder/drupal
# Set an Alias to the Magento codebase
Alias /shop /var/www/sitefolder/magento
<Directory />
Order Deny, Allow
Deny from all
</Directory>
<Directory /var/www/sitefolder/>
Order Deny, Allow
Deny from all
</Directory>
# Configuration of the Drupal codebase root
<Directory /var/www/sitefolder/drupal>
AllowOverrride None
Order Deny, Allow
Allow from all
<ifmodule mod_rewrite.c="">
RewriteEngine on
#Drupal specific protection and rewrites go here
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
...
</IfModule>
</Directory>
# Configuration of the Magento codebase root
<Directory /var/www/sitefolder/magento>
#Magento specific protection and rewrites go here
AllowOverrride None
Order Deny, Allow
Allow from all
<ifmodule mod_rewrite.c="">
RewriteEngine on
RewriteBase /shop
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-i
RewriteRule .* index.php [L]
...
</IfModule>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment