Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6670797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:18:41+00:00 2026-05-26T03:18:41+00:00

We have a single webinterface in Symfony2 which is used by a number of

  • 0

We have a single webinterface in Symfony2 which is used by a number of
clients.
Each client enters our site by a different URL.
For example:

  • client A enters from clientA.our-domain.com
  • client B enters from clientB.our-domain.com
  • client C might even join from clientC.com, i.e. using their own selected domain instead of a sub-domain of ours

However, regardless of the URL they use, they end up at the same
machine: our website.

Right now we use the same CSS for all of them, regardless of which
client. We would love it if we could design a stylesheet for
each client with client-specific color schemes
.
I don’t want to set up a separate webserver for each client, so I’m
looking to select the stylesheet dynamically.

Now, in the HTTP ‘Host’ header one can see which URL the client used,
right.
Can this be used, for example in app.php, to set some global variable
which defines the client?
Twig might read this variable in the main template and decide which
stylesheet to use based on it, perhaps?

Also, should we then use css variables? This might be preferable to keeping complete stylesheet ‘clones’ for each client, if only the colors change.

So to sum up:

  • Can the ‘host’ HTTP header be used in Symfony2 to indicate to Twig which stylesheet to use?
  • Should we use CSS variables to identify the colors in the scheme, or is there a better way?

Thanks in advance!

Dieter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:18:42+00:00Added an answer on May 26, 2026 at 3:18 am

    Personally, I’d prefer using a special CSS file for each site (containing the styling, that’s different for each site, like colors or background images). E.g. site-clientA.our-domain.com.css.

    Then you could use something like this:

    <link rel="stylesheet" type="text/css" 
          href="/path/to/css/site-{{ app.request.host }}.css" />
    

    Or

    {% if app.request.host in ['site-clientA.our-domain.com', 'site-clientB.our-domain.com', 'site-clientC.our-domain.com'] %}
      <link rel="stylesheet" type="text/css" 
            href="/path/to/css/site-style1.css" />
    {% elseif ... %}
      ...
    {% endif %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single NSDictionary object which contains a large number of custom objects.
I have a single entry output from a paradox table which is imported into
We have a Single Statement FUNCTION in SQL Server 2005 which uses CONTAINSTABLE(). All
i have single php dynamic page that load image each time app user is
I have single image where all mine site logos/images are clubbed,so how i can
we have different kinds of monitoring software, each one has its own pourpose and
I have the following file which process a single XML file and pushes it
I have a single URL accessible through a servlet that I have locked down
On Unix one can have single socket used for both IPv6 and IPv4 (
I wrote simple iOS app which countdown the time til midnight. I have single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.