<tfoot id='i9oim'></tfoot>

    <small id='i9oim'></small><noframes id='i9oim'>

      <bdo id='i9oim'></bdo><ul id='i9oim'></ul>

    <i id='i9oim'><tr id='i9oim'><dt id='i9oim'><q id='i9oim'><span id='i9oim'><b id='i9oim'><form id='i9oim'><ins id='i9oim'></ins><ul id='i9oim'></ul><sub id='i9oim'></sub></form><legend id='i9oim'></legend><bdo id='i9oim'><pre id='i9oim'><center id='i9oim'></center></pre></bdo></b><th id='i9oim'></th></span></q></dt></tr></i><div id='i9oim'><tfoot id='i9oim'></tfoot><dl id='i9oim'><fieldset id='i9oim'></fieldset></dl></div>
    <legend id='i9oim'><style id='i9oim'><dir id='i9oim'><q id='i9oim'></q></dir></style></legend>
    1. WordPress 链接全部重定向到双 URL

      时间:2023-06-06
        <legend id='Kz21a'><style id='Kz21a'><dir id='Kz21a'><q id='Kz21a'></q></dir></style></legend>

          • <bdo id='Kz21a'></bdo><ul id='Kz21a'></ul>
            <i id='Kz21a'><tr id='Kz21a'><dt id='Kz21a'><q id='Kz21a'><span id='Kz21a'><b id='Kz21a'><form id='Kz21a'><ins id='Kz21a'></ins><ul id='Kz21a'></ul><sub id='Kz21a'></sub></form><legend id='Kz21a'></legend><bdo id='Kz21a'><pre id='Kz21a'><center id='Kz21a'></center></pre></bdo></b><th id='Kz21a'></th></span></q></dt></tr></i><div id='Kz21a'><tfoot id='Kz21a'></tfoot><dl id='Kz21a'><fieldset id='Kz21a'></fieldset></dl></div>

            <small id='Kz21a'></small><noframes id='Kz21a'>

            <tfoot id='Kz21a'></tfoot>

                  <tbody id='Kz21a'></tbody>
                本文介绍了WordPress 链接全部重定向到双 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                一位开发人员在他的本地机器上建立了一个 WordPress 网站.然后他将整个安装迁移到服务器上.自然,sql中的所有链接都设置为localhost:8888.然后我运行了一个 SQL 更新来修复链接,使它们指向正确的域(现在是一个 ipaddress/~username 链接).我已经仔细检查了我的工作,一切看起来都是正确的.

                A fellow developer built a WordPress website on his local machine. He then migrated the whole installation onto a server. Naturally, all the links in sql were set to localhost:8888. I then ran a SQL update to fix the links so they pointed to the correct domain (which right now is an ipaddress/~username link). I've double checked my work, and it all looks correct.

                UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
                UPDATE wp_options SET option_value = replace(option_value, 'feed://www.olddomain.com', 'feed://newdomain.com');
                UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
                UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
                UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
                

                我使用了该编码,但其中包含适当的域信息.

                I used that coding, but with the appropriate domain information in there.

                现在是发生了什么.

                每当我进入主页时,它都可以工作,但图像不显示.然后我点击一个链接,或前往 wp-admin,它在 urlbar 中显示了两次 url.所以它会变成这样:

                Whenever I go to the homepage, it works, but the images don't show up. then i click on a link, or travel to teh wp-admin, and it shows the url twice in the urlbar. so it goes to something like:

                http://newdomain.com/~user/http://newdomain.com/~user/post-name-blah-blah-blah
                

                .htaccess 文件都是默认的,(如果 WordPress 在一个子目录中,它应该有重写规则而不是/?)

                the .htaccess file is all default, (if WordPress is in a subdirectory should it have a rewrite rule for that instead of just /?)

                如果没有像 SQL 中那样列出,什么会导致网站上的每个链接两次访问同一个 URL?

                What could cause every link on the site to go to the same url twice, if none of them are listed like that in SQL?

                更新:

                好的,所以我删除了整个数据库并重新设置,然后站点就可以正常工作了.当然,这意味着我丢失了所有内容.我猜我在某处搞砸了 sql 查询.但是我找不到任何有两个 url 的地方,或者甚至会导致这种情况.随着我发现我的问题,将会有更多更新.

                Alright, so I erased the whole database and reset that up, and then the site works fine. of course that means I lose all my content. I'm guessing i screwed up the sql query's somewhere down the line. But I can't find anywhere that has two urls, or would even cause this. More updates coming as I figure out my issue.

                推荐答案

                我解决了!希望如果其他人来到这里并犯了同样的错误,这会有所帮助.在 wp_options 表中,site_urlhome 的行需要在它们前面有 http:// .不知何故,我的 sql 查询破坏了该部分.我当然没有注意到,因为地址看起来是正确的,因为这通常有效.但在这种情况下,它会导致一些链接永无止境的循环,而在其他情况下,它只会将地址翻倍.

                I Solved it! Hopefully if anyone else comes here and has the same mistake, this will help. In the wp_options table the rows for site_url and home need to have http:// in front of them. Somehow on my, my sql query busted that portion. Of course I didn't notice because the address looked correct, because that normally works. but in this case it caused a never-ending loop with some links, and in others just doubled the address.

                这篇关于WordPress 链接全部重定向到双 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在ansible中为不同的主机使用另一个任务中的 下一篇:MySQL查询以根据自定义列名和值获取值

                相关文章

                最新文章

              1. <i id='PS9rt'><tr id='PS9rt'><dt id='PS9rt'><q id='PS9rt'><span id='PS9rt'><b id='PS9rt'><form id='PS9rt'><ins id='PS9rt'></ins><ul id='PS9rt'></ul><sub id='PS9rt'></sub></form><legend id='PS9rt'></legend><bdo id='PS9rt'><pre id='PS9rt'><center id='PS9rt'></center></pre></bdo></b><th id='PS9rt'></th></span></q></dt></tr></i><div id='PS9rt'><tfoot id='PS9rt'></tfoot><dl id='PS9rt'><fieldset id='PS9rt'></fieldset></dl></div>
              2. <tfoot id='PS9rt'></tfoot>

                <small id='PS9rt'></small><noframes id='PS9rt'>

                  <legend id='PS9rt'><style id='PS9rt'><dir id='PS9rt'><q id='PS9rt'></q></dir></style></legend>
                    • <bdo id='PS9rt'></bdo><ul id='PS9rt'></ul>