• <i id='msou2'><tr id='msou2'><dt id='msou2'><q id='msou2'><span id='msou2'><b id='msou2'><form id='msou2'><ins id='msou2'></ins><ul id='msou2'></ul><sub id='msou2'></sub></form><legend id='msou2'></legend><bdo id='msou2'><pre id='msou2'><center id='msou2'></center></pre></bdo></b><th id='msou2'></th></span></q></dt></tr></i><div id='msou2'><tfoot id='msou2'></tfoot><dl id='msou2'><fieldset id='msou2'></fieldset></dl></div>

    <small id='msou2'></small><noframes id='msou2'>

      <bdo id='msou2'></bdo><ul id='msou2'></ul>
  • <legend id='msou2'><style id='msou2'><dir id='msou2'><q id='msou2'></q></dir></style></legend>
    <tfoot id='msou2'></tfoot>

      1. 从 Zend 框架 url 中删除 index.php

        时间:2023-05-29
        <i id='njDl7'><tr id='njDl7'><dt id='njDl7'><q id='njDl7'><span id='njDl7'><b id='njDl7'><form id='njDl7'><ins id='njDl7'></ins><ul id='njDl7'></ul><sub id='njDl7'></sub></form><legend id='njDl7'></legend><bdo id='njDl7'><pre id='njDl7'><center id='njDl7'></center></pre></bdo></b><th id='njDl7'></th></span></q></dt></tr></i><div id='njDl7'><tfoot id='njDl7'></tfoot><dl id='njDl7'><fieldset id='njDl7'></fieldset></dl></div>
        <tfoot id='njDl7'></tfoot>
        • <bdo id='njDl7'></bdo><ul id='njDl7'></ul>
        • <legend id='njDl7'><style id='njDl7'><dir id='njDl7'><q id='njDl7'></q></dir></style></legend>

              <small id='njDl7'></small><noframes id='njDl7'>

                <tbody id='njDl7'></tbody>

                  本文介绍了从 Zend 框架 url 中删除 index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 zend 框架开发一个模块,并且我已经使用 zf create project 创建了一个项目命令

                  I am developing a module using zend framework and I have created a project using zf create project command

                  当我尝试使用 ip/folder/controller/action 访问 url 时,当我尝试使用 ip/folder/index.php/controller/访问时,它给出了错误未找到错误action 我可以访问,但在这两种情况下我都无法包含 js、css 文件,我的 htaccess 是

                  when i try to access the url using ip/folder/controller/action it is giving error not found error when i try access using ip/folder/index.php/controller/action i am able to access but i am unable to include js,css files in both cases and my htaccess is

                  RewriteEngine On
                  RewriteCond %{REQUEST_FILENAME} -s [OR]
                  RewriteCond %{REQUEST_FILENAME} -l [OR]
                  RewriteCond %{REQUEST_FILENAME} -d
                  RewriteRule ^.*$ - [NC,L]
                  RewriteRule ^.*$ index.php [NC,L]
                  

                  和 index.php 是

                  and the index.php is

                  <?php
                  
                     // Define path to application directory
                     defined('APPLICATION_PATH')
                     || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
                  
                     // Define application environment
                      defined('APPLICATION_ENV')
                      || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') 
                         ? getenv('APPLICATION_ENV') : 'production'));
                  
                     // Ensure library/ is on include_path
                       set_include_path(implode(PATH_SEPARATOR, 
                       array(realpath(APPLICATION_PATH . '/library'), get_include_path(),
                  )));
                  
                  /** Zend_Application */
                  require_once 'Zend/Application.php';    
                  
                  // Create application, bootstrap, and run
                  $application = new Zend_Application(
                      APPLICATION_ENV,
                      APPLICATION_PATH . '/configs/application.ini'
                  );
                  $application->bootstrap()->run();
                  

                  推荐答案

                  尝试将其添加到您的 .htaccess 中:

                  Try adding this to your .htaccess:

                  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.php 
                  RewriteRule ^index.php(.*)$ /path/to/your/installation$1 [R=301,L]
                  

                  用正确的路径替换/path/to/your/installation

                  Replace /path/to/your/installation with the correct path

                  这篇关于从 Zend 框架 url 中删除 index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:发送邮件而不阻止“执行" 下一篇:使用 PHP Farm 激活 php 扩展的问题

                  相关文章

                  <tfoot id='P1S7t'></tfoot>
                    <bdo id='P1S7t'></bdo><ul id='P1S7t'></ul>
                  <legend id='P1S7t'><style id='P1S7t'><dir id='P1S7t'><q id='P1S7t'></q></dir></style></legend>

                • <i id='P1S7t'><tr id='P1S7t'><dt id='P1S7t'><q id='P1S7t'><span id='P1S7t'><b id='P1S7t'><form id='P1S7t'><ins id='P1S7t'></ins><ul id='P1S7t'></ul><sub id='P1S7t'></sub></form><legend id='P1S7t'></legend><bdo id='P1S7t'><pre id='P1S7t'><center id='P1S7t'></center></pre></bdo></b><th id='P1S7t'></th></span></q></dt></tr></i><div id='P1S7t'><tfoot id='P1S7t'></tfoot><dl id='P1S7t'><fieldset id='P1S7t'></fieldset></dl></div>
                    1. <small id='P1S7t'></small><noframes id='P1S7t'>