If you wish to add rewrite rules to customize your application, you can do so by placing a '.htaccess' file in the public folder of your application. When you deploy your application, the Zend Server deployment daemon does not place it in the document root but rather in a new directory. It also automatically adds an "Alias" directive in the web server's configuration which points to the location on the disk in which your application was deployed. Due to this, you must take special care when writing custom rewrite rules that point to files on the disk. To avoid problems, we suggest the following:
- Use relative locations and never specify the full path of the file.
- Make sure to include a "RewriteBase" directive pointing to your application's relative URL.
Example .htaccess file
In the example below you can see an apache rewrite rule that checks if the file to be served exists. If it does not, it serves the index.php file.
To test your rule you can try to access: http://<my_container>.my.phpcloud.com/<my_app_relative_url>/<some_path> . This will serve the index.php file if that path does not exist.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteBase /my_apps_relative_url
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
You can read more about writing proper rewrite rules in apache's mod_rewrite documentation at http://httpd.apache.org/docs/current/mod/mod_rewrite.html

