Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在使用from MVC模式时包含.CSS.JS文件(重写引擎)_Php_Css_Model View Controller - Fatal编程技术网

Php 如何在使用from MVC模式时包含.CSS.JS文件(重写引擎)

Php 如何在使用from MVC模式时包含.CSS.JS文件(重写引擎),php,css,model-view-controller,Php,Css,Model View Controller,我正在使用MVC模式,但我有一个问题。当我们使用此引擎时: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> 重新启动发动机 重写cond%{

我正在使用MVC模式,但我有一个问题。当我们使用此引擎时:

<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?url=$1[PT,L]
但是,在使用时:

<link href="assets/css/bootstrap.css" rel="stylesheet">

这将重写为一个新模式及其模板问题。 请给我一个好的使用方法。是使用白色XAMPP的好方法


Than应在此行中添加:

RewriteRule ^(assets/(.+)) - [L]
按此顺序:

RewriteEngine On
RewriteRule ^(assets/(.+)) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

应在这一行中添加:

RewriteRule ^(assets/(.+)) - [L]
按此顺序:

RewriteEngine On
RewriteRule ^(assets/(.+)) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]

#允许通过
RewriteRule^(.+)?/assets/(.+)-[L]
未测试但“应该”的方式创建资产文件夹work@JamesLalor谢谢,但它不起作用。
RewriteRule^(assets/(.+)-[L]
#允许通过
RewriteRule^(.+)?/assets/(.+)-[L]
未测试但“应该”的资产文件夹 work@JamesLalor谢谢,但它不起作用。
RewriteRule^(资产/(.+)-[L]