【发布时间】:2016-11-09 19:18:22
【问题描述】:
我已将我的网站克隆到 xampp 以获取本地版本。我的 WordPress 站点位于 C:/xampp/htdocs/my-website。
我还将我的数据库克隆到本地,并将网址从网络更改为http://localhost/my-website。
我已经制作了一个 .htaccess 文件,并且已经在 httpd.conf 中设置了 xampp 覆盖所有文件,该文件不会被忽略。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /my-website/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my-website/index.php [L]
</IfModule>
# END WordPress
我可以通过http://localhost/my-website 看到我的网站,但我的所有 .js、.css、.png 等文件都找不到。我从 Firefox 中查看了网络分析,链接不完整。
这是错误的链接:
http://localhost/wp-content/themes/storefront/startseite.js
但它应该是这样的:
http://localhost/my-website/wp-content/themes/storefront/startseite.js
我在谷歌上搜索了很多,但找不到解决方案。希望你知道答案。
谢谢大家!
【问题讨论】:
-
有人知道答案吗?
标签: javascript php wordpress apache .htaccess