Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Two Silverstripe sites on the same server


Reply


2 Posts   1532 Views

Avatar
JuLo

Community Member, 37 Posts

13 July 2012 at 7:20pm

Hey guys,

I've looked around the forums and found a lot of similar questions, but not exactly the same situation.

I have a Silverstripe website, that sits in the root folder and works great.
Let's says it works on www.domain.com

I created another Silverstripe website, that physically sits in a subfolder of the same server.
Let's call the subfolder domain2.

It is accessible if I go to www.domain.com/domain2/

I got the registrar to point my new domain name, www.domain2.com to the same spot.
Used GoDaddy Deluxe account Hosted Domains to redirect www.domain2.com to the subfolder.

Now I get a 500 error from the GoDaddy Apache server.

I know that my issue probably comes from the .htaccess files, but I am unsure of what I should do.

Can this work in this configuration?

Or do I have to move both to subfolders and use the .htaccess file at the root to redirect?
If so, what should it say? (knowing that I use .htaccess about once a year and forget all about it until I have to use it again; and it's been a year).

Thanks in advance.

JuLo

Avatar
jasonsypolt

Community Member, 5 Posts

6 August 2012 at 2:52am

Are you using a hosting control panel to configure the sites, or do you have direct access to apache to configure the sites? I always place all of my sites into their own separate subfolders.

/var/www/site1
/var/www/site2
/var/www/site3
etc.

This virtual host config is pretty much all that Apache needs to run the sites as long as php5 and mod_rewrite are enabled. I leave the .htaccess files alone and as long as the domains are pointed to the server, Apache serves up the correct site based on the domain specified in SerName and ServerAlias.
<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName site1.com
   ServerAlias www.site1.com
   DocumentRoot /var/www/site1
   <Directory />
      Options FollowSymLinks
      AllowOverride All
   </Directory>
   <Directory /var/www/site1/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
   </Directory>
</VirtualHost>