Codeigniter导航到没有index.php的站点

时间:2019-04-04 16:28:25

标签: php apache .htaccess codeigniter

我一直在youtube上关注本教程:

https://www.youtube.com/watch?v=ck5pTkRumPw&t=351s

在12:00分钟左右,该教程讨论了有关更新.htaccess文件的问题,以便您无需使用index.php即可导航到页面。

我无法以这种方式访问​​该页面。

我正在使用称为server01的Windows 2008服务器(即使这很重要)。

我的文件结构如下:

codeIgniter
  >Application
  >System
  .htaccess
  index.php

当前,我的.htaccess文件如下所示:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

在我的配置文件中,我具有以下内容:

$config['base_url'] = 'server01.usa.tests.com/codeIgniter/HomeController';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

在routes.php文件中,我具有以下内容:

$route['default_controller'] = 'HomeController';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

我什至更新了httpd.conf文件,使其包含以下内容:

<Directory "d:/htdocs/codeIgniter">
  Options FollowSymLinks
  AllowOverride All
  Order deny,allow
  Deny from all
  Satisfy all   
</Directory>

由于我已经更新了httpd.conf文件,所以当我导航到该站点时,出现以下错误:

**Forbidden**

You don't have permission to access /codeIgniter/HomeController on this server.

我在做什么错了?

我可能必须删除对httpd.conf文件所做的更新。

另一方面,我尝试使用以下链接的各种答案均未成功:

CodeIgniter htaccess and URL rewrite issues

CodeIgniter removing index.php from url

Codeigniter can't remove index.php

0 个答案:

没有答案
相关问题