I have a domain with ssl (canvas.example.com), and have created a new zend appli开发者_JAVA技巧cation that I want to add to that domain (canvas.example.com/newapp). It is on an apache server. Is this possible? I have tried to modify my virtual host, and also played with .htaccess, but no luck. Perhaps some route rules in Zend could get this working, I'm running out of ideas...
Assuming you're using the default Zend_Application .htaccess
file:
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
You need to tell mod_rewrite
what the base directory is, using RewriteBase
, like so:
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteBase /newapp/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
(Where this file goes in the same directory as your index.php)
This is the only zend specific thing going on; everything else should be just as configuring a vhost in apache.
精彩评论