[solved] cPanel - Magento - Multistore Setup

#1
Hi!
I switched to Litespeed and installed cloudlinux this weekand, most sites on the server work fine but we have an issue with a Mmagento multistore and its rewrite-rules in htaccess:

Right now this is the proper setup for magento, based on their wiki:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work

The website beckenbodentrainer.info loads fine, but when you click on a link in the navigation you are redirected to the Base Webstore of the Magento-Multistore (maison-x.at)

Since on some sites we also have the problem with some CSS, images I assume the following happens:

http://beckenbodentrainer.info/ -> rewrite rule from .htaccess is being used
http://beckenbodentrainer.info/problem.html -> its not using the .htaccess and looking for the html file and this causes the redirect to the main store cause the MAGE_RUN_CODE / MAGE_RUN_TYPE is not being set.

Please help and advice.
Many thanks in advance!
 
Last edited by a moderator:

mistwang

LiteSpeed Staff
#2
You can turn on rewrite logging by put

RewriteLogLevel 9

in the

<VirtualHost ...>
ServerName beckenbodentrainer.info
...
</VirtualHost>

section.

then check error log for details.
 
#4
Yes it contains these rules:

RewriteCond %{HTTP_HOST} www\.maison-sensualite\.at [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:maisonsens]
RewriteCond %{HTTP_HOST} www\.maison-sensualite\.at [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:website]

RewriteCond %{HTTP_HOST} ^maison-sensualite\.at [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:maisonsens]
RewriteCond %{HTTP_HOST} ^maison-sensualite\.at [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:website]

RewriteCond %{HTTP_HOST} ^beckenbodentrainer\.info [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:beckenb]
RewriteCond %{HTTP_HOST} ^beckenbodentrainer\.info [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:website]

RewriteCond %{HTTP_HOST} ^www\.beckenbodentrainer\.info$
RewriteRule ^/?$ "http\:\/\/beckenbodentrainer\.info\/" [R=301,L]
 

NiteWave

Administrator
#5
Code:
RewriteCond %{HTTP_HOST} ^www\.beckenbodentrainer\.info$
RewriteRule ^/?$ "http\:\/\/beckenbodentrainer\.info\/" [R=301,L]
should be better to change to
Code:
RewriteCond %{HTTP_HOST} ^www\.beckenbodentrainer\.info$
RewriteRule ^(.*)$ http://beckenbodentrainer.info/$1 [R=301,L]
maybe there are other rewrite rules ? these rules looks fine.
 
#6
SOLVED:

it appears to be working fine now.
All the 404 errors from todays' replies have been caused by commented-out rewrite rule for resources which are magento-internal and handled by index.php:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

I've re-enabled these because Magento can't work without them.

All other rewrite problems appear to be caused by incorrectly *positioned* new rewrite rules which were added to compensate for setenv directive (which exists only in Apache, but not in Litespeed).
Rewrite rules have to be ordered correctly, because their ordering is what determines the rule precedence. So, I just moved those rules above index.php rule, and it all appears to be working now.
 
Top