.htaccess rewrite url remove CSS,JS,AND IMAGES 无论我做什么都不起作用
.htaccess rewrite url remove CSS,JS,AND IMAGES Whatever i do its not working
我看过 Whosebug 上的所有帖子,但我看到的都没有得到答复。
我正在使用:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]
RewriteRule profile/username/(.*)/ profile.php?username=
RewriteRule profile/username/(.*) profile.php?username=
我是我的个人资料,php 使用这些标签作为我的头:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo ucwords($profileData->first_name); ?> - Facebook</title>
<link rel="stylesheet" href="/assets/css/style.css" type="text/css">
<base href="index.php" />
我做了什么还是不行请帮忙!
因为您正在重写规则,所以您还需要重写基本 href HTML,或者只需将完整的 url 添加到您的样式、js 和图像中。
基本 href 示例:
<head>
<base href="https://www.yourwebsite.com/">
</head>
我看过 Whosebug 上的所有帖子,但我看到的都没有得到答复。 我正在使用:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]
RewriteRule profile/username/(.*)/ profile.php?username=
RewriteRule profile/username/(.*) profile.php?username=
我是我的个人资料,php 使用这些标签作为我的头:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo ucwords($profileData->first_name); ?> - Facebook</title>
<link rel="stylesheet" href="/assets/css/style.css" type="text/css">
<base href="index.php" />
我做了什么还是不行请帮忙!
因为您正在重写规则,所以您还需要重写基本 href HTML,或者只需将完整的 url 添加到您的样式、js 和图像中。 基本 href 示例:
<head>
<base href="https://www.yourwebsite.com/">
</head>