Php .htacces错误404代码点火器+;独自创立
为什么我的bootstrap.css链接返回错误的链接?引导的链接变为:Php .htacces错误404代码点火器+;独自创立,php,codeigniter,twitter-bootstrap,configuration,url-routing,Php,Codeigniter,Twitter Bootstrap,Configuration,Url Routing,为什么我的bootstrap.css链接返回错误的链接?引导的链接变为: http://localhost/ciproj/localhost/ciproj/assets/css/bootstrap.css 但我用的是这样的代码 <link rel="stylesheet" text="text/css" href="<?php base_url(); ?>assests/css/bootstrap.css /> 我的.htaccess是 <IfModule mo
http://localhost/ciproj/localhost/ciproj/assets/css/bootstrap.css
但我用的是这样的代码
<link rel="stylesheet" text="text/css" href="<?php base_url(); ?>assests/css/bootstrap.css />
我的.htaccess是
<IfModule mod_rewrite.cs>
RewriteEngine On
RewriteCond $1 !^(index\.php|images|Scripts|css|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
试着从
$config['base_url'] = 'localhost/ciproj';
到
更新:
试一试
重新启动发动机
1美元^(索引\.php | images | assets | Scripts | css | robots\.txt)
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
您是否尝试过将您的基本url
留空。@falinsky抱歉,这不适用于我。已经试过了。我知道这与我的.htaccess有关,但我看不出问题所在。正如您所看到的,基本url变为两倍,这意味着我的重写规则不起作用,因为我假设我正在为cssim new添加一个exeption,因此您可以指定我如何清理它。htaccess代码:)感谢您进一步清理它。现在bootstrap.css的url是正确的。但它仍然返回一个404错误页面未找到你知道我在htaccess的config目录中缺少了什么吗?@KiXOrtillan更新了answernevermind man。它已经开始工作了。又犯了一个愚蠢的错误。谢谢你的帮助!干杯
-ciproj
-application
-system
-index.php
-assets
-css
-bootstrap.css
-js
-.htaccess
$config['base_url'] = 'localhost/ciproj';
$config['base_url'] = 'http://localhost/ciproj';
<IfModule mod_rewrite.cs>
RewriteEngine On
RewriteCond $1 !^(index\.php|images|assets|Scripts|css|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>