Bootstrap3不使用PHP MVC.htaccess
当我创建MVC应用程序时,引导样式没有访问。我的.htaccess文件是什么Bootstrap3不使用PHP MVC.htaccess,php,css,.htaccess,twitter-bootstrap,Php,Css,.htaccess,Twitter Bootstrap,当我创建MVC应用程序时,引导样式没有访问。我的.htaccess文件是什么 RewriteEngine on RewriteRule !.(js|css|ico|gif|jpg|png|swf|ttf|eot|svg|woff|GIF)$ index.php RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d Rewr
RewriteEngine on
RewriteRule !.(js|css|ico|gif|jpg|png|swf|ttf|eot|svg|woff|GIF)$ index.php
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
我的html编码是这样的
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>efrg</h1>
</body>
</html>
efrg
删除.htaccess文件后,它可以正常工作。.htaccess文件有什么问题?我也正确地集成了bootstrap.min.css文件
这是我的mvc代码
<?php
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$urlParams = explode('/', $url);
if (count($urlParams) === 5) {
header("location:$url"."users/login");
} else {
$modelName = $urlParams[4] . 'Model';
require "./model/$modelName.php";
$controllerName = $urlParams[4] . 'Controller';
require "./controller/$controllerName.php";
$actionName = $urlParams[5] . 'Action';
$obj = new $controllerName();
$obj->$actionName();
include "./view/$urlParams[4]/$urlParams[5].php";
}
?>
并没有人注意到,若header包含require或include方法,那个么一些函数就不能正常工作。正如我前面提到的,我的引导程序并没有像现在这样工作。我使用include而不是header()。就是这样。没有错误。。代码运行良好没有运行的css或js规范我没有得到你@abhi ahereque你的问题不清楚我的引导样式不工作。当你使用.htaccess时,如果你给出绝对路径,每个文件都可以访问