在 Codeigniter Digital Ocean 中出现 404 错误

在Digital Ocean中托管了一个 Codeigniter 应用程序。登录后出现404错误。


$config["base_url"] = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["SCRIPT_NAME"]);


$config["index_page"] = "index.php";


$config["uri_protocol"]  = "REQUEST_URI";


和 htacess 代码是


<IfModule mod_rewrite.c>

RewriteEngine On

#RewriteCond %{REQUEST_FILENAME} !-f

#RewriteCond %{REQUEST_FILENAME} !-d

#RewriteRule ^(.*)$ index.php/$1 [L]


RewriteCond $1 !^(index\.php|public|\.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

#RewriteRule ^(.*)$ index.php?$1

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

</IfModule>


桃花长相依
浏览 67回答 1
1回答

浮云间

需要启用 mod_rewrite 。
打开App,查看更多内容
随时随地看视频慕课网APP