1

I have a multistore magento setup using domain aliases. How do I remove the index.php from the domain alias sites in the htaccess file? Below is my current code, which only removes it from the main site.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
  • This might be related to your vhosts config and not to Magento itself. – mbalparda Feb 4 '15 at 19:27
  • I have disabled the redirect for the domain alias through the plesk panel. I am using the htaccess to define the multistore environments. What vhost config are you referring to and where can I check it in the plesk panel? – Dana Laney Feb 4 '15 at 19:34
  • 1. Stop using plesk. Its not going to allow you to configure a server to the extent necessary to run magento well. 2. Your domain aliases may not be picking up the .htaccess at all. As a quick test, try adding a redirect rule and see if it gets picked up on the aliases. – Matt Dunbar Mar 3 '15 at 23:31
1

You could try creating separate folders for each store, then symlinking app, includes, js, lib, media, skin and var. This allows you to manage your .htaccess and index.php independently for each domain.

It sounds like you are trying to do this in cPanel so this is probably the best approach.

http://www.crucialwebhost.com/kb/how-to-setup-multiple-magento-stores/#addon-domain-method

EDIT: Just saw your comment that you are using Plesk. It might be a little different but this approach should still work.

| improve this answer | |
  • I would prefer to not create extra folders. – Dana Laney Feb 4 '15 at 21:37
  • 1
    This can be avoided, and should be whenever possible so that code duplication isn't necessary (multiple index.php and .htaccess files to manage). – Matt Dunbar Mar 3 '15 at 23:33
  • @MattDunbar, How do you manage environment vars if not via htaccess or index.php? I don't think he has the ability to edit the vhost to add the SetEnv from the plesk dashboard. Manual edits to the vhost will be overwrite the next time the dashboard saves a vhost setting. This approach is the same that both Crucial and Nexcess use. If you are running separate stores use will likely need to manage separate htaccess files anyways. You could probably get away with symlinks the index.php file though. – Daniel Smith Mar 3 '15 at 23:55
  • @DanielSmith There are conditionals available in .htaccess (SetEnvIf). Also, plesk shouldn't be seen as a reasonable option for managing a Magento Server, its too limiting for all of the configuration tweaks necessary for Magento to run well. – Matt Dunbar Mar 4 '15 at 0:14
  • @MattDunbar, personally I would not use Plesk as it adds unneeded overhead. It is however a reasonable option for running a Magento server and can be properly configured to run as such. OP's question was pertaining to configuration on a Plesk system, not a request for a hosting recommendation. – Daniel Smith Mar 4 '15 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.