Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.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
Html Can';t访问css文件,htaccess_Html_Apache_.htaccess - Fatal编程技术网

Html Can';t访问css文件,htaccess

Html Can';t访问css文件,htaccess,html,apache,.htaccess,Html,Apache,.htaccess,我添加了一个.htaccess文件来重定向一些请求,例如: /home/index变为/index.php?controller=home&action=index¶ms=,但该.htaccess文件也阻止我访问/content/styles.css文件。出于某种原因,我可以访问/content/images/default.png Htaccess内容: Options +Indexes Options -MultiViews RewriteEngine On RewriteCond

我添加了一个.htaccess文件来重定向一些请求,例如:
/home/index
变为
/index.php?controller=home&action=index¶ms=
,但该.htaccess文件也阻止我访问/content/styles.css文件。出于某种原因,我可以访问
/content/images/default.png

Htaccess内容:

Options +Indexes
Options -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.[^\/]+)\/(.[^\/]+)\/(.+)\/*$ index.php?controller=$1&action=$2&params=$3 [QSA,L]
RewriteRule ^(.[^\/]+)\/*$ index.php?controller=$1 [QSA,L]
RewriteRule ^(.[^\/]+)\/(.[^\/]+)\/*$ index.php?controller=$1&action=$2 [QSA,L]
它位于public_html目录中

我尝试将另一个带有
选项+索引的.htaccess添加到
/content/
目录,但没有更改。从
/content/
访问任何文件,但不阻止任何
/content/images/

此:
-不起作用。 这:
mysite.com/content/styles.css
-不起作用。 这:
mysite.com/content/images/default.png
-有效

//编辑:


当我将
/content/styles.css
移动到
/content/styles/styles.css
时,它工作得很好,但是这个配置有什么问题吗?

在你想要访问
css
png
文件的页面中添加这个标签

<base href="http://www.yourdomain.com/" />


然后尝试访问该页面。

这对我不起作用,我在public_html中的
index.php
和包含所有页面html的'layout.php'中都放了这一行。它可能是其他文件中的一些奇怪的.htaccess配置(该站点由一家公司托管),尽管我没有找到。