equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Tool |
16 * @package Zend_Tool |
17 * @subpackage Framework |
17 * @subpackage Framework |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: HtaccessFile.php 20897 2010-02-04 06:31:52Z ralph $ |
20 * @version $Id: HtaccessFile.php 25211 2013-01-10 21:10:30Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Tool_Project_Context_Filesystem_File |
24 * @see Zend_Tool_Project_Context_Filesystem_File |
25 */ |
25 */ |
31 * A profile is a hierarchical set of resources that keep track of |
31 * A profile is a hierarchical set of resources that keep track of |
32 * items within a specific project. |
32 * items within a specific project. |
33 * |
33 * |
34 * @category Zend |
34 * @category Zend |
35 * @package Zend_Tool |
35 * @package Zend_Tool |
36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
36 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
38 */ |
38 */ |
39 class Zend_Tool_Project_Context_Zf_HtaccessFile extends Zend_Tool_Project_Context_Filesystem_File |
39 class Zend_Tool_Project_Context_Zf_HtaccessFile extends Zend_Tool_Project_Context_Filesystem_File |
40 { |
40 { |
41 |
41 |
62 public function getContents() |
62 public function getContents() |
63 { |
63 { |
64 $output = <<<EOS |
64 $output = <<<EOS |
65 |
65 |
66 RewriteEngine On |
66 RewriteEngine On |
|
67 # The following rule tells Apache that if the requested filename |
|
68 # exists, simply serve it. |
67 RewriteCond %{REQUEST_FILENAME} -s [OR] |
69 RewriteCond %{REQUEST_FILENAME} -s [OR] |
68 RewriteCond %{REQUEST_FILENAME} -l [OR] |
70 RewriteCond %{REQUEST_FILENAME} -l [OR] |
69 RewriteCond %{REQUEST_FILENAME} -d |
71 RewriteCond %{REQUEST_FILENAME} -d |
70 RewriteRule ^.*$ - [NC,L] |
72 RewriteRule ^.*$ - [NC,L] |
71 RewriteRule ^.*$ index.php [NC,L] |
73 # The following rewrites all other queries to index.php. The |
|
74 # condition ensures that if you are using Apache aliases to do |
|
75 # mass virtual hosting, the base path will be prepended to |
|
76 # allow proper resolution of the index.php file; it will work |
|
77 # in non-aliased environments as well, providing a safe, one-size |
|
78 # fits all solution. |
|
79 RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$ |
|
80 RewriteRule ^(.*)$ - [E=BASE:%1] |
|
81 RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L] |
72 |
82 |
73 EOS; |
83 EOS; |
74 return $output; |
84 return $output; |
75 } |
85 } |
76 |
86 |