.htaccess Magento stopping access to other sites on server
-
16-10-2019 - |
Question
I have a mutliple magento site on a Shared Server. I appeciate that this is not ideal at all to share site on a shared server as the resources are limited, however its working ok.
I have to have the .htaccess file in the route of my server, however my sites in in sub folders
Site1.com looks at TheServerRoute/Website/Website1/
Site2.com looks at TheServerRoute/Website/Website2/
This works perfectly, however if I want to throw a standard site on the same server, HTML or PHP (not magento) i get issues.
Basically i put the site at TheServerRoute/Website/Website3/
if i navigate to Site3.com i get nothing, 404 server error, if I navigate to Site3.com/index.html it will show the html page I made, equally if i go to Site3.com/index.php it will show the php page I made. I think this is related to my .htaccess folder rewriting things or something like that, so index files do not automatically show when navigating to a folder. Should the .htaccess that I have in my route, even be sat in my route? or should i have a file sat in the individual site routes (i.e. Website1 and Website2 folders) etc?
I am new to Linux and the use of .htacccess and somewhat lost...
I have tried - deleting the .htaccess files (clearly this messes up my magento access) - deleting the .htaccess and placing a copy inside the relevant magento folders
Now I am a stuck for methods. Perhaps my understanding on a .htaccess file is wrong...
Hopefully you guys can help, and we can provide a resource for people to look at, as googling this came up with nothing...
Look forward to some thought, questions, comments and suggestions :)
UPDATE I have narrowed it down to two areas in my .htaccess file. Either
## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>
which i don't think is an issue, but
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>
which i think is where the problem lies.
Is it possible to do a RewriteRule to html and then if this doesn't exist then try php?
Or am i just better off making a standard index.php file in each directory which redirects to the HTML version?
Solution
SOLVED IT !!
I had
## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>
However I needed to include .HTML before the .PHP
## default index file
DirectoryIndex index.html index.php
<IfModule mod_php5.c>
This sets the priority of index.html before index.php so it will load .html if it exists, then .php if it doesn't...
OTHER TIPS
I would think this is caused by where you .htaccess file is.
You should store you .htaccess file here
TheServerRoute/Website/Website3/.htaccess
and then you should'nt have issues.