2

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?

1
  • if you need any more information, feel free to ask, I could even provide a copy of the .htaccess file if you like, as there's nothing too sensitive in there. Thanks Commented Jun 17, 2013 at 10:15

2 Answers 2

1

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

0

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.

4
  • this .htaccess file is for the magento store rules, which are at TheServerRoute/Website/Website2/ but if I put the .htaccess file here, then my site doesnt work at all... or atleast the back end doesnt Commented Jun 17, 2013 at 10:47
  • could this be an issue with not having a reqwrite base in it? do i need to change #RewriteBase / to RewriteBase /Website/Website2/ Commented Jun 17, 2013 at 10:48
  • why are you not using httpd.conf file in the apache conf folder? This would be the correct place to set up virtual servers
    – Toby Allen
    Commented Jun 17, 2013 at 13:06
  • Correction @Toby Allen, its a Shared server not a VPS, I have corrected my original post to reflect this, sorry for the confusion. My mistake Commented Jun 17, 2013 at 13:44

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.