ISAPI ZEND url 重写添加额外的“/index.php/”进入网址

发布于 2024-08-05 09:47:58 字数 928 浏览 3 评论 0原文

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

管理站点的 url 现在是

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

,过去也是,应该是

//admin.site.com/schedules

额外的 index.php 被插入到 url 中。但管理站点内的所有链接都不包含index.php,因此它们不起作用。如果将index.php 插入任何网址,它就会起作用。这个 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]

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

We recently reinstalled our web site on our server, the sys admin says it is an exact rebuild, and it indeed looks to me that it is, but there is something different going on. I did not originally develop the site, and those who did are no longer available.

urls for the admin site are now

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

and used to be, and should be

//admin.site.com/schedules

The extra index.php is getting inserted in the url. But all links within the admin site do not include the index.php so they do not work. If you insert the index.php into any url, it works. Where did this index.php come from and how do I eliminate it from the rewrite rules so the links will work.

This is what my httpd.conf file reads:

# 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]

Thank you! Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱要勇敢去追 2024-08-12 09:47:58

您需要实施并启用 ApacheModrewrite。然后将 .htaccess 文件放入您的 admin.site.com 文件夹中
其内容将是:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d


RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

You need to implement and enable ApacheModrewrite. And then put a .htaccess file in your admin.site.com folder
Its content will be :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d


RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文