我即将上线由 Codeigniter 提供支持的网站。我想从网址中删除index.php,而不是这样:
http://www.mysite.com/index.php/controller
我得到这样的东西:
http://www.mysite.com/controller
到目前为止,非常简单。过去我使用过 Codeigniter 文档提供的 mod-rewrite 规则:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
这就像一个魅力。然而,对于这个网站,我必须使用 Zeus Web 服务器而不是 Apache,而且我对它根本不熟悉。 Zeus 有自己的重写规则,例如:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^[^/]*\.html$ index.php
会变成这样:
match URL into $ with ^/[^/]*\.html$
if matched then set URL = /index.php
谁能帮我重写宙斯的第一条规则?非常感谢您的帮助!
想通了 - 以下对我来说效果很好:
map path into SCRATCH:DOCROOT from /
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}
look for file at %{SCRATCH:DOCROOT}%{SCRATCH:REQUEST_URI}
if not exists then look for dir at %{SCRATCH:REQUEST_URI}%{SCRATCH:REQUEST_URI}
if not exists then set URL = /index.php%{SCRATCH:REQUEST_URI}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)