Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Symfony 4未完成CSS加载_Css_.htaccess_Symfony - Fatal编程技术网

Symfony 4未完成CSS加载

Symfony 4未完成CSS加载,css,.htaccess,symfony,Css,.htaccess,Symfony,我刚刚将我的站点部署在一个在Debian10下工作的VPS服务器上 我添加了.htaccess文件,路由工作正常 但我有个问题 我想知道这是怎么做到的 然而,在开发模式下,一切正常 这个问题来自.htaccess文件,因为当我删除这个文件时,css可以正常工作,但是路由不能 除了我不太精通正则表达式 <IfModule mod_rewrite.c> #teste RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L]

我刚刚将我的站点部署在一个在Debian10下工作的VPS服务器上

我添加了.htaccess文件,路由工作正常

但我有个问题

我想知道这是怎么做到的

然而,在开发模式下,一切正常

这个问题来自.htaccess文件,因为当我删除这个文件时,css可以正常工作,但是路由不能

除了我不太精通正则表达式

<IfModule mod_rewrite.c>
#teste
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#睾丸
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
重新启动发动机
重写条件%{HTTPS}关闭
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]

重新启动发动机
重写基/
#向Craft发送可能的404请求
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则(+)index.php?p=$1[QSA,L]

Symfony网站上有关于配置web服务器的文档,可以帮助您花点时间修改您的问题。修复代码块的呈现。还有代码本身:看起来好像发生了复制和粘贴问题……您的HTTP到HTTPS重定向位于错误的位置,但除此之外,
.htaccess
文件没有任何问题。问题可能是您正在使用CSS文件的相对URL路径。请参阅网站管理员堆栈上的这个问题:“开发”模式有什么区别?这是如何解决OPs问题的?(事实并非如此)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>