I have two questions.
First, I am in need of having a referral in my site. In PHP it would look like this: www.mysite.com/join?ref=100
and then on the page you would $_get(ref);
Zend does not like this, so how do I implement this.
The second question is how can I have a subdomain on my site with the framework. I want to put a forum on my site, and tried a subdomain and loaded it, but it will not work as Zend pushes everything through the index.php
. So how do I make it exist on the same site. I cannot put it in a module because it is a site within itself. Short of using another domain I am stuck.
Thanks for your help.
you should edit mod_rewrite rules in .htaccess
here is my rules:
For your second question about subdomains, there seem to be three issues:
At the network level, you would configure your hosting environment so that all the subdomains point to a single folder in your hosting environment. Then deploy as standard ZF installation there, including the standard
.htaccess
.At the app level, your single ZF install will be receiving requests for all your subdomains. You can then use ZF's app-routing mechanism to handle those requests. In particular, you could configure various Zend_Controller_Router_Route_Hostname routes to handle the requests with your selected controllers/actions.
The last bit is which controllers and actions? It sounds like a good idea to create a separate module for each subdomain. So the Hostname routes above can detect the subdomain and handle the request with the appropriate module (and controller/action).
Getting GET parameters such as www.mysite.com/join?ref=100 should work normally. Assuming that
join
is your controller andindex
is your action in that controller that paratmeterref
could be obtained using:So I don't see a reason why ZF would not like it.
Unfortunately I cannot help you with the second question, as I don't know.