htaccess不会加载图像和CSS

时间:2021-04-16 15:20:55

I recently changed the directory to one of my websites and wrote a rule within the htaccess file to handle the redirect. However, the css and images fail to load now.

我最近将目录更改为我的一个网站,并在htaccess文件中编写了一条规则来处理重定向。但是,css和图像现在无法加载。

Options -Indexes
Options +FollowSymLinks

RewriteEngine On
RewriteBase /
RewriteRule ^(\.*)$ http://www.myDomain.com/temp_site/$1 [R=301,L]

EDIT:

Some of the files that don't work are

一些不起作用的文件是

http://www.myDomain.com/css/style.css
http://www.myDomain.com/images/me.jpg
http://www.myDomain.com/about.php

http://www.myDomain.com/css/style.css http://www.myDomain.com/images/me.jpg http://www.myDomain.com/about.php

1 个解决方案

#1


Try this rule:

试试这条规则:

RewriteRule !^temp_site/ /temp_site%{REQUEST_URI} [R=301,L]

#1


Try this rule:

试试这条规则:

RewriteRule !^temp_site/ /temp_site%{REQUEST_URI} [R=301,L]