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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:34:54+00:00 2026-06-09T18:34:54+00:00

I have problem with ‘dynamic subdomains’ on zend_router_hostname, i have code like(i don’t have

  • 0

I have problem with ‘dynamic subdomains’ on zend_router_hostname, i have code like(i don’t have subdomains like that but whant use subdomain as route parametr):

protected function _initRoutes() {
        $front = Zend_Controller_Front::getInstance();
        $router = $front->getRouter();
        $config = $this->getOptions();
        Zend_Registry::set("config", $config);
        $routerHost = new Zend_Controller_Router_Hostname(':language.mysite.local',
                        array('controller' => 'index',
                            'action' => 'index',
                            'language'=>'pl')
);
        $router->addDefaultRoutes();
        $routes = $router->getRoutes();
        foreach ($routes as $key => $routeEntry) {
            $router->addRoute($key, $routeHost->chain($routeEntry));
        }
    }

But when I try do call eg.: pl.mysite.local i get Server not found error.
My /etc/hosts file is:

127.0.0.1       localhost
127.0.2.1       mysite.local
127.0.3.1       mysite.dev
127.0.4.1       mysite.production

And my vhost config is:

VirtualHost *:80>
   DocumentRoot "/var/www/mysite/public"
   ServerName mysite.local
   ServerAlias *.mysite.local
   # This should be omitted in the production environment
   SetEnv APPLICATION_ENV development
   <Directory "/var/www/mysite/public">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
   </Directory>

</VirtualHost>

I tried to use dnsmasq with entry like:

address=/local/127.0.0.1

But problem still occurs, i dont know how to resolve this situation, any clue what i’m doing wrong?

  • 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-09T18:34:56+00:00Added an answer on June 9, 2026 at 6:34 pm

    Adding wildcards to /etc/hosts is not possible but, also required in our case.
    However, this is how to go about it:

    Install dnsmasq

    then,

    cp /usr/share/doc/dnsmasq-base/examples/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
    

    then, edit your /usr/local/etc/dnsmasq.conf and add:

    address=/mysite.local/127.0.0.1
    listen-address=127.0.0.1
    

    Start DNSMASQ:

    ~$ sudo ./usr/local/sbin/dnsmasq
    

    Further, instead of using Zend_Controller_Router_Hostname use Zend_Controller_Router_Route_Hostname

    Go through the document and you should be OK!

    $toRoute = new Zend_Controller_Router_Route_Hostname(
        ':language.mysite.local',
        array(
            'controller' => 'index',
            'action' => 'index',
            'language' => 'pl')
        ) );
    

    PS: Don’t forget to mention nameserver as 127.0.0.1 in /etc/resolv.conf . At times, restarting system helps!

    Enjoy coding! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with my code. I don't know what am I doing wrong.
I have problem with Activities navigation, searching works good. Activities hierarchy looks like that:
I have problem with passing variables through views. But, first some code // i
I have problem with latin chars, here is the code: $stopWords = array('i','a','about','an','and','are','as','at','be','by','com','de','en','for','from','how','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www', 'on',
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with code. I have written a function for extracting a parameter,
i have problem with jquery submit and post. I would like to submit a
I have problem with php's preg_match.I want to make something like this : When
I have problem in my PHP code. I'm trying to make internet shop and
I have problem like this https://dev.twitter.com/discussions/4563 if (webResponse.Headers[Content-Encoding] == gzip) { byte[] bytes =

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.