页面未找到codeigniter

时间:2015-10-01 09:00:19

标签: php codeigniter

我正在尝试安装codeigniter应用。但只有主页正在运作...... 这是我的文件: 的的config.php

$config['base_url'] = "http://localhost/folder/subfolder/";
$config['index_page'] = "";

routes.php文件

$route['default_controller']    = "home";
$route['search']                = "search/index";

的.htaccess

RewriteEngine ON 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Options All -Indexes

我正在尝试 http://localhost/folder/subfloder/search 或其他控制器,我找不到404页面。主页工作正常。

问题出在哪里?

谢谢!

找到解决方案:

唯一要补充的是:RewriteBase /folder/subfolder/

2 个答案:

答案 0 :(得分:0)

您可以使用此.htaccess(使用子域名)

# Enforce www
# If you have subdomains, you can add them to 
# the list using the "|" (OR) regex operator
RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC]
RewriteRule ^(.*)$ http://www.domain.tld/$1 [L,R=301]

# Enforce NO www
#RewriteCond %{HTTP_HOST} ^www [NC]
#RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]

答案 1 :(得分:0)

我建议所有CodeIgniter安装使用以下HTaccess:

import seaborn as sns
titanic = sns.load_dataset("titanic")
sns.countplot(y="deck", hue="class", data=titanic, palette="Greens_d",
              order=titanic.deck.value_counts().iloc[:3].index)

来自Laravel的HTAccess,永远不会让我失望!