LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Magento (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=40)
-   -   [solved] cPanel - Magento - Multistore Setup (http://www.litespeedtech.com/support/forum/showthread.php?t=6659)

nnpro 02-11-2013 12:49 PM

[solved] cPanel - Magento - Multistore Setup
 
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/knowl...i-domain-setup
http://www.magentocommerce.com/knowl...es-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!

mistwang 02-11-2013 03:54 PM

You can turn on rewrite logging by put

RewriteLogLevel 9

in the

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

section.

then check error log for details.

webizen 02-11-2013 03:57 PM

http://beckenbodentrainer.info/problem.html should still use .htaccess.

Does .htaccess have SetEnvIf Host .. only or it contains other rules?

nnpro 02-11-2013 11:54 PM

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 02-12-2013 12:55 AM

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.

nnpro 02-12-2013 01:46 AM

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.

NiteWave 02-12-2013 02:14 AM

thanks. mark as [solved]


All times are GMT -7. The time now is 02:55 PM.