我在重定向页面时是 codeigniter 的新手,默认情况下不会加载 index.php,所以我在 htaccess 文件中尝试了以下代码。我已经安装了 php 5.3.10、apache 服务器和 postgres 数据库。因此,如果除了更改 .htaccess 和 httpd.conf 之外还需要进行任何新配置,请告诉我。我已经看到以前就同一问题提出的问题,并且我参考了这些问题中的所有内容,但我仍然无法解决这个问题。请让我知道要做哪些额外的事情。
.htaccess 文件
<IfModule mod_rewrite.c> RewriteEngine On #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #This last condition enables access to the images and css folders, and the robots.txt file RewriteCond $1 !^(index\.php|public|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^/(index\.php|assets/|humans\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
httpd.conf 文件 ServerName localhost
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>