$this->url() to another subdomain

Posted by Supertino7 on Stack Overflow See other posts from Stack Overflow or by Supertino7
Published on 2010-05-14T09:51:39Z Indexed on 2010/05/14 9:54 UTC
Read the original article Hit count: 174

Filed under:
|
|
|
|

Hello,

I created subdomain for my application.

host_www.type = "Zend_Controller_Router_Route_Hostname"
host_www.route = "www.mywebsite.com"
host_www.defaults.module = "produits"
host_www.defaults.controller = "produits"
host_www.defaults.action = "index"

fiche_boutique.route = "ficheboutique/:boutique"
fiche_boutique.defaults.controller = "boutique"
fiche_boutique.defaults.action = "fiche-boutique"
fiche_boutique.defaults.module = "default"
fiche_boutique.chain = "host_www"

host_produits.type = "Zend_Controller_Router_Route_Hostname"
host_produits.route = "produits.mywebsite.com"
host_produits.defaults.module = "produits"
host_produits.defaults.controller = "produits"
host_produits.defaults.action = "index"

fiche_produit.type = "Zend_Controller_Router_Route_Regex"
fiche_produit.route = "([-\w]+).htm"
fiche_produit.reverse = "%s.htm"
fiche_produit.map.1 = "q"
fiche_produit.defaults.module = "produits"
fiche_produit.defaults.controller = "produits"
fiche_produit.defaults.action = "voir-produit"
fiche_produit.chain = "host"

I don't know if the syntax in this zend config ini file is correct, in particular for routes chaining.

Once I'm on this subdomain, urls constructed with $this->url() like this :

<a href="<?= $this->url(array('boutique' => 1234), 'fiche_boutique', true) ?>">
Visit this store
</a>

still point to the subdomain produits.mywebsite.com, where I want it to point to www.mywebsite.com

For the moment, I do this :

<a href="http://www.mywebsite.com<?= $this->url(array('boutique' => 1234), 'fiche_boutique', true) ?>">
Visit this store
</a>

But it's not flexible at all.

Is there a solution, a parameter to add, or my config file is wrong ?

thanks in advance for your help.

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework