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]
  • This might be related to your vhosts config and not to Magento itself.
    – mbalparda
    Feb 4, 2015 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, 2015 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. Mar 3, 2015 at 23:31

1 Answer 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.


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

  • I would prefer to not create extra folders.
    – Dana Laney
    Feb 4, 2015 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). Mar 3, 2015 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. Mar 3, 2015 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. Mar 4, 2015 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. Mar 4, 2015 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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