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 MATLAB动图的问题
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名