Search

Hi All,

So I want to have multiple symphony installs, each in their own directory but not in wwwRoot, a subdirectory.

However they will share the same backend database.

I am looking at the .htaccess and I am not sure what gets changed.

I think it is this line: RewriteRule (^|/). - [F]

but I dont quite know how to fix it with the directory name of where the site will live.

What web server are you using? Apache? If so, you can solve this in two ways:

  1. Use NameVirtualHost to distinguish the Symphony instances by host name (instance1.local, instance2.local, instance3.local)
  2. Add a RewriteBase directive to the .htaccess of your instance. Here you can specify the relative location of your instance (/instance1, /instance2, /instance3) which will be used as the base of the url rewriting.

I think the line you are looking for is this one:

RewriteEngine on
RewriteBase /name_of_subdirectory/

antoine, spot on, that should have been more obvious for me. This will allow me to front end the whole thing to make some decisions about which version of the site to serve the user, dump them there and then all the links on the site will work for whatever version of the site they are on.

remie, thanks, that was good reading for me as well.

Would this work cross-domain rather than subfolders?

www.something.com

www.somethingelse.com

I did something a while back with one DB, two symphony installs and it worked without rewrite but I had to change the URLs to assets like images and could only update through one of the domains. Is the above solution better or not applicable?

@munki: if you use NameVirtualHost in apache it will work. You need to add a listener for NameVirtualHost to port 80 in your httpd.conf:

NameVirtualHost *:80

You can then create VirtualHost instances by adding:

<VirtualHost *:80>
    ServerName www.something.com
    ServerAlias something.com

    [Add Apache directives here for specific host configuration]

</VirtualHost>

Repeat this for any other domain you want to add.

@remie

Thanks, I'll try that next build.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details