2

I have three website to be uploaded on single server. The server admin has set it up as.

1) The main website to be put on root folder 2) two subfolders are made in which i have to put other two websites.

Domains have been redirected accordingly to subfolders. Now i have added following line of code into the htaccess file

## DirectoryIndex index.html index.php
SetEnvIf Host .*test1.* MAGE_RUN_CODE=safety
SetEnvIf Host .*test1.* MAGE_RUN_TYPE=store
SetEnvIf Host .*test2.* MAGE_RUN_CODE=onestop
SetEnvIf Host .*test2.* MAGE_RUN_TYPE=store
SetEnvIf Host .*test3.* MAGE_RUN_CODE=royalview
SetEnvIf Host .*test3.* MAGE_RUN_TYPE=store

I uploaded this htaccess to the root folder. It is automatically directing it to the sub folders.

Now the problem is when I installed websites test2 and test3. It’s not working properly. In test1 it is not loading the CSS. When I try to access CSS file directly it’s giving me 500 Internal Server Error

Same is with test3. Here the CSS is loading but images aren't. It’s giving the same error while accessing directly.

I have set proper permissions for all folders and files, so there is no issue with permissions.

I think there is an issue with htaccess.

Can anyone guide me through this?

2

After lots of effort i solved the issue. It was an issue caused due to .htaccess

Now after making modifications in .htaccess of the root folder. I checked the subfolders where other two of my websites were kept.

1) First thing i did was delete the .htaccess file in that folders.

2) As my images were not loading, i went to the media folder there i found .htaccess file. The content of .htaccess file was as follows

Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php

    RewriteRule .* ../get.php [L]
</IfModule>

I am not sure how it was giving Internal Server Error. But i deleted it from media folder of both subfolders as i though it wont be much of a risk. This started loading my images.

As i am not an expert on .htaccess i am not sure what security threat it will cause on the website.

It would be great if anyone can advice me on this

  • 1
    The .htaccess blocks http requests for files in media which you don't want to be accessed, e.g. Everything in customer/ – Fabian Blechschmidt Dec 26 '13 at 20:42
  • 1
    adding .htaccess blocks all my images. What should i do for it ? – Dexter Dec 28 '13 at 4:43
  • My problem also solved with removing htaccess from the media file, so now the question is will there be security issues or any issues if i remove htaccess file. My htaccess also looks same like Dexter's except FollowSymLinks doesn't work so i have to replace it with SymLinksifOwnerMatch. – Anil Nov 28 '14 at 21:17
  • I don't think removing .htaccess from media folder will make any security threat but i am not really sure network security is not my strong field – Dexter Nov 29 '14 at 4:30
1

Adding an empty .htaccess blocks it, or adding the original? Internal Server Error normally means that you use a command in the htacces which you are not allowed to or which doesn't exist. Just have a look into the apache error_log (not the magento one!) for more information.

Dependong on the concrete source of the error you can:

  1. delete the htaccess
  2. remove the unusable command
  3. send your hosting provider a mail and let allow him the command
  4. change your hosting provider
  • i am using godaddy for hosting. But i am facing lots of issues lately with it. – Dexter Dec 28 '13 at 8:11
  • No idea how strict GoDaddy is. Maybe someone else can tell you more – Fabian Blechschmidt Dec 28 '13 at 8:11

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.