【发布时间】:2016-05-06 21:50:54
【问题描述】:
我想创建一个应用网址“http://example.com”。但是输入 url,它显示“HTTP Error 403.14 - Forbidden”。当我在 'http://example.com/index.php' 之类的 url 的最后插入'index.php' 时,登录页面正在浏览器中呈现 我已经改了
$config['base_url'] = 'http://example.com';
$config['index_page'] = '';
和
$config['uri_protocol'] = 'REQUEST_URI';
在 config.php 文件中。然后我将 .htaccess 文件与应用程序和系统文件夹一起放在 codeigniter 根文件夹中。然后在 .htaccess 文件中我用
编码<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
我只想从 url 中删除“index.php”。我正在使用 IIS 8.5 网络服务器。
【问题讨论】:
-
很抱歉,由于没有任何 IIS 经验,我无法给您准确的答案。但是这里列出了几个答案。第二个答案对我有用。 stackoverflow.com/questions/1445385/… 您可能会尝试的另一件事是多编辑 .htaccess “RewriteBase / RewriteRule 上的 RewriteEngine ^(application|system|\.svn) index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [QSA,L]"
-
我已经这样了,但没用。 apache 和 iis 的工作方式一样吗
-
好像不行:stackoverflow.com/questions/25439087/… 那么试试这个。实际上,您似乎还需要 URL Rewrite 模块,并且规范(conf)看起来与 apache 不同。
-
你使用什么版本的 CI?
-
我用你的代码编辑了 .htaccess “RewriteBase / RewriteRule 上的 RewriteEngine ^(application|system|\.svn) index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond % {REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [QSA,L]" 和 o/p 是相同的“HTTP Error 403.14 - Forbidden”
标签: php .htaccess codeigniter url iis-8.5