Magento 1.7 htaccess Error – How to Fix

.htaccesserrormagento-1.7

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?

Best Answer

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

Related Topic