简体   繁体   English

Zend Framework HTTP路由器

[英]Zend Framework HTTP router

I have a site with some static pages that lie in à folder called ../application/default/views/scripts/statiskt/student/(index.html) (seen from the webroot). 我有一个站点,其中有一些静态页面位于à文件夹中,该文件夹名为../ application / default / views / scripts / statiskt / student /(index.html)(从webroot看)。

I can access these "static" pages via mydomain.se/statiskt/student/(index.html). 我可以通过mydomain.se/statiskt/student/(index.html)访问这些“静态”页面。

The problem is that i want to be able to access them via mydomain.se/student/(index.html). 问题是我希望能够通过mydomain.se/student/(index.html)访问它们。

I am using the Zend Framework with the Zend router. 我在Zend路由器上使用Zend框架。

I am barely familiar with the Zend Framework, so i'm asking you - Is this possible? 我几乎不熟悉Zend框架,所以我问你-这可能吗? And how do i achieve it? 而我该如何实现呢?

Sent from an iPhone with weird spellchecking, sorry for any typos. 从iPhone发送而来的拼写检查很奇怪,对于任何错别字,我们深表歉意。

Have you tried to modify any of the examples from the ZF Manual on Routes ? 您是否尝试修改《 ZF路线手册》中的任何示例?

  $route = new Zend_Controller_Router_Route_Static(
      'student',
      array('controller' => 'statiskt', 
            'action' => 'student')
  );
  $router->addRoute('staticStudent', $route);

If there is no controller and action for the static pages, eg they are not used with ZF's MVC components, then rewrite the URL from the .htaccess in your /pub folder to point to the appropriate path. 如果静态页面没有控制器和动作,例如它们不与ZF的MVC组件一起使用,则从/pub文件夹中的.htaccess重写URL,以指向适当的路径。 See http://httpd.apache.org/docs/2.0/misc/rewriteguide.html 参见http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM