UPD: Solvable. The problem was that we are using nginx as an interface. Therefore nginx does not pass HTTP_HOST to apache.
Hello!
I had a problem getting the subdomain parameter in my base controller on the production server, while on localhost this is normal. other parameters from url-like controller, the action is returned, as it should be.
this returns null on creation:
$agencyName = (string) $this->_getParam('agency');
no changes to .htaccess:
RewriteEngine On RewriteRule ^main - [L,NC] RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
and here are my vhost settings:
<VirtualHost *:8080> ServerName agencies.domain.com ServerAlias *.agencies.domain.com ErrorLog /var/log/apache2/agencies.domain_errors.log DocumentRoot /var/www/agencies.domain.com/public/ <Directory "/var/www/agencies.domain.com/public"> Options -Indexes FollowSymLinks Includes DirectoryIndex index.shtml index.php AllowOverride All # Controls who can get stuff from this server. Order allow,deny Allow from all </Directory> </VirtualHost>
Does anyone know why this is happening?
UPD:
routers in bootstrap
public function run() { $frontController = Zend_Controller_Front::getInstance(); $router = $frontController->getRouter(); $plainPathRoute = new Zend_Controller_Router_Route( ':module/:controller/:action/*', array( 'module' => 'default', 'controller' => 'index', 'action' => 'index', ) ); $config = $this->getOptions(); $hostnameRoute = new Zend_Controller_Router_Route_Hostname( ':agency.' . $config['siteUri'], NULL, array( 'agency' => '([a-z0-9]+)' ) ); $router->addRoute('subdomain', $hostnameRoute->chain($plainPathRoute)); parent::run(); }
and yes, I have $ config ['siteUri'] and I also tried using: agency.domain.com getting the same problem again