Php 当试图创建干净的url时,css将消失';s
我试图实现干净的网址到我的网站,但我遇到了一个问题。当我尝试加载默认url feks:www.example.com时,一切都正常工作,但当我尝试这样更改它:www.example.com/home/,除了我的图像和css之外,一切都会加载 只是一些测试html:Php 当试图创建干净的url时,css将消失';s,php,css,html,.htaccess,Php,Css,Html,.htaccess,我试图实现干净的网址到我的网站,但我遇到了一个问题。当我尝试加载默认url feks:www.example.com时,一切都正常工作,但当我尝试这样更改它:www.example.com/home/,除了我的图像和css之外,一切都会加载 只是一些测试html: <html> <head> <meta charset="UTF-8"> <title></title> <link href="css.c
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>just an example text</p>
</body>
</html>
只是一个示例文本
我的htaccess文件:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^index.php[L]
您必须使用绝对链接:
<link href="http://www.example.com/css.css" rel="stylesheet" type="text/css">
或在
中添加:
或
<base href="http://www.example.com/">
<base href="/">