无法从codeIgniter URL删除的index.phpURL、codeIgniter、php、index

由网友(精神失常、适合你)分享简介:我的目录结构是/ var / WWW / CI /下的文件夹CI的所有文件夹即,应用程序,系统。已创建在CI .htaccess文件。My directory structure is /var/www/CI/ with all the folders viz., application, system under...

我的目录结构是/ var / WWW / CI /下的文件夹CI的所有文件夹即,应用程序,系统。已创建在CI .htaccess文件。

My directory structure is /var/www/CI/ with all the folders viz., application, system under the folder CI. Have created a .htaccess file under CI.

以下是code在.htacess。

Following is the code in .htacess.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index.php|public|images|robots.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

不过本地主机/ CI /博客提供了404错误。任何人都可以引导,以治所在今是错的?

Still localhost/CI/blog gives 404 error. Can anyone guide as to where this rule is wrong?

推荐答案

请尝试以下

首先,请确保您设置的配置文件类似如下..

At first, make sure you set the config file like the following..

$config['index_page'] = '';

另外,还要确保的mod_rewrite 在httpd.conf文件中,之后被启用,覆盖位于项目的根文件夹不是在应用程序文件夹下面的$ C $ .htaccess文件C.。

Also make sure that mod_rewrite is enabled in the httpd.conf file and after that, overwrite your .htaccess file which is located your project root folder not in the application folder with the following code..

RewriteEngine on
RewriteCond $1 !^(index.php|public|.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
阅读全文

相关推荐

最新文章