【问题标题】:ISAPI ZEND url rewrite adding extra "/index.php/" into urlISAPI ZEND url 重写在 url 中添加额外的“/index.php/”
【发布时间】:2010-11-30 14:14:43
【问题描述】:

我们最近在我们的服务器上重新安装了我们的网站,系统管理员说这是一个精确的重建,在我看来确实是这样,但是发生了一些不同的事情。我最初并未开发该网站,而那些开发过的人已不再可用。

现在是管理网站的网址

//admin.site.com/index.php/schedules

过去是,应该是

//admin.site.com/schedules

额外的 index.php 被插入到 URL 中。但是管理站点中的所有链接都不包含 index.php,因此它们不起作用。如果将 index.php 插入任何 url,它就可以工作。这个 index.php 是从哪里来的,我如何从重写规则中消除它,以便链接能够正常工作。

这是我的 httpd.conf 文件的内容:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.56

# turn on rewriting RewriteEngine On RewriteBase /

# for all files not found in the file system,
# reroute to "index.php" bootstrap script,
# keeping the query string intact. 
RewriteCond %{HTTP_HOST} ^admin.site.com$ 
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteCond %{HTTP_HOST} ^admin.site.com$ 
RewriteRule ^.*$ index.php [NC,L]

谢谢!任何帮助将不胜感激。

【问题讨论】:

    标签: zend-framework url-rewriting isapi httpd.conf isapi-rewrite


    【解决方案1】:

    您需要实现并启用 ApacheModrewrite。然后在 admin.site.com 文件夹中放置一个 .htaccess 文件 其内容将是:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-09
      • 2015-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-09
      • 1970-01-01
      相关资源
      最近更新 更多