Search

Hi folks,

I'm having some odd results with my page URL parameters, which is cause by my additional mod_rewrite rules.

I'm running Symphony (v2.2.3) in a multi-site configuration, i.e. one symphony installation and one database but serving up multiple web sites. This was achieved by creating 3 pages in the root of the system and then child pages underneath those. So the system looks like:

Symphony root
    Site 1 home: /site1/
        Site 1 product page: /site1/products/
        Site 1 about page: /site1/about/
    Site 2 home: /site2/
        Site 2 product page: /site2/products/
        Site 2 about page: /site2/about/
    Site 3 home: /site3/
        Site 3 product page: /site3/products/
        Site 3 about page: /site3/about/

Then, in my .htaccess, I have added some redirects in the appropriate place so that regular Symphony functionality works as usual, but you are sent into the correct structure depending on your domain.

Example .htaccess configuration can be seen on Pastie. Note the section marked:

### Redirect site requests according to host name - Added by DF

This all works REALLY well, including 1st level URL parameters, e.g:

/site1/products/productcategory/

However, if I configure a second URL parameter for the products page, the Symphony engine gives me a duplicate of the 1st when redirected... By which I mean a url of:

/site1/products/productcategory/product/

gives me "productcategory" for both parameters 1 & 2

I'm sure this is down to the redirection, because if I hit the server by IP and go into the correct structure manually it works fine and I get the right parameters. I suspect that I've just missed something with my added RewriteRules. Any mod_rewrite geniuses out there care to suggest a fix?? :)

Thanks, David.

Hmm...

Yes it does. Having re-read the article I can see that Michael is doing a direct redirect with his line:

RewriteRule ^(.*/?)$ index.php?symphony-page=domain2/$1&%{QUERY_STRING} [L]

Whereas I was trying to modify the request URL just slightly and then pass it on to the general Symphony redirect rule. If I do the same as Michael, everything seems to work correctly.

I'd like to understand the difference between his approach and mine - there's obviously something incredibly subtle I can't see.

I'll implement this as a quick fix and then get on to someone I know who's a mod_rewrite genius!

Thanks, David.

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