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 8778259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:29:19+00:00 2026-06-13T19:29:19+00:00

We have a website that developed in symfony 1.4 framework. This website should be

  • 0

We have a website that developed in symfony 1.4 framework. This website should be able to have multiple domains. Each domain has its special homepage and everything else. Actually the domain must be such a parameter for each action that according to it, the action gets the data from database and show it.

For example, we have a about us page. We save about us contents in about_us table. This table has a website_id. We keep website information in the website table. Suppose this:

website (id, title, domain)
about_us (id, content, website_id)

website contents:

(1, 'foo', 'http://www.foo.com') and (2, 'bar', 'http://www.bar.com')

about_us contents:

(1, 'some foo', 1) and (2, 'some bar', 2)

The question is, how should I configure my Symfony project, to be able to do like this? to get domain as a parameter and use that in Symfony actions?

  • 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-06-13T19:29:21+00:00Added an answer on June 13, 2026 at 7:29 pm

    You can create your own route class extending sfRoute. This route will add a ‘domain’ parameter to all requests:

    //apps/frontend/lib/routing/myroute.class.php
    
    class myRoute extends sfRoute
    {
    
        public function matchesUrl($url, $context = array())
        {
            // first check if it is a valid route:
            if (false === $parameters = parent::matchesUrl($url, $context))
            {
               return false;
             }
    
            $domain = $context['host'];
    
            // add the $domain parameter:
            return array_merge(array(
                'domain' => $domain
                ), $parameters);
        }
    }
    

    Routing.yml (example):

    default_module:
      class: myRoute
      url:   /:module/:action/:id
      ...
    

    In your action you get the domain with:

     $request->getParameter('domain');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this website that I developed. It is acting weird. I logged onto
I have a website developed using Symfony framework by some other developers. I have
I have developed a website that now has to be cloned for several clients.
We have developed a website that has quite a lot of flash in it
I have developed an IIS website that has worked perfectly fine when hosted with
I have a asp.net web site that was developed on the .Net Framework v2
So basically I have website that has names of cities that can be checked
I have a website that is mirrored cross two sub-domains. So I have separate
I would like to add value to my website that I have developed at
We have developed an exe and we have created a website to download that

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.