douzhi2988 2016-11-09 19:18
浏览 52

XAMPP Wordpress安装无法找到图片/文件

I've cloned my website to xampp for a local version. My WordPress site is located in C:/xampp/htdocs/my-website.

I've also cloned my database to local and changed the urls from the web to http://localhost/my-website.

I've made a .htaccess file and already set xampp overwrite all in httpd.conf that the file won't be ignore.

# 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

I can see my website with http://localhost/my-website but all my .js, .css, .png etc. files can't be found. I looked in network analystic from Firefox and the links are not complete.

This is the wrong link:

http://localhost/wp-content/themes/storefront/startseite.js

But it should look like this:

http://localhost/my-website/wp-content/themes/storefront/startseite.js

I've searched a lot in google but can't find a solution. Hope you know a answer.

Thanks guys!

</div>
  • 写回答

2条回答

  • dongse3348 2016-11-09 20:18
    关注

    changed the urls from the web to http://localhost/my-website....

    How did you do that? In wp_options? Or Appearance>>General Settings?

    You should use interconnectit.com WordPress Serialized PHP Search Replace Tool to change all URLs in the database options and in post/page content. That tool will correctly change all URLs and it also correctly deals with serialized data in the database.

    And, after you make a directory or folder move of a WordPress site, resave permalinks in Settings>permalinks. That will write the correct permalinks to .htaccess.

    Also see Moving WordPress « WordPress Codex

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计