迁移本地本地的wordpress,图像链接指向localhost-无法纠正 [英] Migrating wordpress local to live, image links point to localhost - cannot rectify

查看:51
本文介绍了迁移本地本地的wordpress,图像链接指向localhost-无法纠正的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望获得有关实时迁移我的wordpress本地站点的技术支持.我在更新指向本地主机目录的图像链接时遇到了一些困难-当站点处于活动状态时,这些链接无效.到目前为止,我还没有对此进行补救,并尝试手动更改sql数据库中的链接以搜索n个替换插件.

I'd like some technical support on the issue of migrating my wordpress local site live. I'm running into some difficulties updating image links which point to localhost directories - which are invalid while the site is live. So far I have not remedied this, and have tried manually changing links in the sql database to search n replace plugins.

如果我更新数据库中"localhost/mywebsitename"的所有实例(再次尝试使用手册,查询和插件)-我的wordpress网站的CSS样式中断(指向子主题下的自定义文件的样式)我曾经用来修改网站).

If I update all instances of my 'localhost/mywebsitename' in my database (again tried manual, with queries, and with plugins) - My wordpress site has css styling break (styling that points to a custom file under a child theme which I used to modify the site).

我尝试过的另一件事是检查损坏的图像,然后在数据库中搜索它们;然后将"localhost"链接替换为"mywebsitename"链接-但这不起作用,而是显示文本.

Another thing I've tried is inspecting the broken images, searched them in my database; then replaced the 'localhost' link with 'mywebsitename' link - but this does not work and displays text instead.

我还尝试过一次重新附加"未附加的图像,但没有区别.

I've also tried 're-attaching' the unattached images one by one, and see no difference.

该站点在我的机器上运行得非常好,因为我是在本地开发的,如果链接指向本地目录,则文件仍然存在.

The site runs perfectly fine on my machine, as I developed it locally and if the links point to local directories the files are still there.

也许有人可以说明情况吗?

Could someone perhaps shed some light on the situation?

推荐答案

除了执行常规的搜索和替换功能外,还需要检查很多事情.

There are a number of things to check as well as doing the usual search and replace functions.

首先,检查您的 htaccess 是正确的.您是localhost副本,文件中可能存在一些重定向问题或url问题,因此只需仔细检查并可能将其替换即可.基本的WP htaccess 可以在网站上找到. WP HTAccess

First, check you're htaccess is correct. You're localhost copy may have some redirect problems or url problems in the file so just double check it and possibly replace it. The basic WP htaccess can be found on the website. WP HTAccess

接下来,您需要在管理面板中检查WP设置.

Next you'll want to check your WP Settings within the admin panel.

首先,进入设置->常规,然后仔细检查WordPress地址和站点地址是否正确.

First, go into settings -> general and double check that WordPress address and Site address are correct.

第二,进入设置->永久链接,并检查链接结构是否正常.

Secondly, go into settings -> permalinks and check that the link structure is okay.

如果仍然无法解决问题,请尝试全新安装全新的wordpress,然后在wordpress工具中使用备份和导入方法.

If this still doesn't work, try doing a whole new clean install of wordpress and then using the backup and import method within the wordpress tools.

有关所有内容的更多信息,请参见此处

More information on everything can be found HERE

这篇关于迁移本地本地的wordpress,图像链接指向localhost-无法纠正的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆