【问题标题】:Sudden change from 'localhost' to 'www.localhost.com' PHP突然从“localhost”更改为“www.localhost.com”PHP
【发布时间】:2012-10-08 17:17:15
【问题描述】:

我有各种应用程序和单个脚本在 XAMPP 中成功运行 - 简单架构根文件夹 (htdocs) == http://localhost/ 或只是 localhost/

我已经下载了一些 Wordpress 网站并将其移至适当的文件夹:它是 www.example.com/blog,我已将其移至 htdocs/blog。我做得很好(文件和文件夹递归搜索和替换,searchandreplacedb2.php 例程),结果是:

输入:http://localhost/blog/

得到:http://www.localhost.com/blog/

使用 Firefox 通知:

连接已重置

在加载页面时重置了与服务器的连接。

注意事项: 1.我尝试删除现有的.htaccess, 2.递归搜索和替换wordpress文件没有任何大小写www.example.com/blog/localhost/blog(通常有)。

【问题讨论】:

  • wp_options 表中检查siteurlhome。根据需要进行修改。

标签: php wordpress xampp


【解决方案1】:

如何将这些行添加到您的 .htaccess 中

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

另外,检查您的数据库。某些表格中的 URL 可能有误。

干杯

【讨论】:

    猜你喜欢
    • 2019-06-13
    • 2011-02-18
    • 2015-01-11
    • 2012-12-11
    • 2016-02-03
    • 2017-07-19
    • 2023-01-19
    • 2010-10-14
    • 2016-06-07
    相关资源
    最近更新 更多