将整个在线站点迁移到本地服务器后,会发现“在此服务器上找不到所请求的URL/LOGIN/”。

时间:2014-03-27 作者:JuJoDi

我遵循了我能找到的大多数Wordpress迁移指南。我采取的步骤总结如下:

从现有生产站点导出我的wp数据库启动一个带有LAMP堆栈、PHPMyAdmin和ssh的新Ubuntu服务器,将我的整个wordpress站点从根目录(htdocs)复制到我的新服务器的/var/www/目录,在新服务器的mysql上创建一个新数据库,从步骤1导入导出更改site_urlhome (我将它们更改为http://)

  • 运行找到的脚本here 清理db的其余部分
  • 当我将浏览器指向本地intranet上新服务器的ip地址时,我得到了错误:

    Not Found
    
    The requested URL /login/ was not found on this server.
    
    Apache/2.2.22 (Ubuntu) Server at 192.168.0.176 Port 80
    
    当我尝试转到/wp admin时,也会出现相同的错误。我想我可能没有正确地指向url,但如果它不是我的新服务器的根目录,我不确定该指向哪里。

    我的htaccess文件位于

    /var/www/.htaccess
    /var/www/wp-content/uploads/.htaccess
    /var/www/wp-content/themes/Portal/library/.htaccess
    /var/www/wp-content/plugins/s2member-files/.htaccess
    /var/www/wp-content/plugins/s2member-logs/.htaccess
    /var/www/wp-content/plugins/akismet/.htaccess
    /var/www/wp-content/plugins/s2member-pro/includes/.htaccess
    /var/www/wp-content/plugins/s2member/includes/jquery/.htaccess
    /var/www/wp-content/plugins/s2member/includes/.htaccess
    
    根的内容。htaccess文件为

    # BEGIN WordPress
    Options FollowSymLinks
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/Appledoc.* [OR]
    RewriteCond %{REQUEST_URI} ^/Javadoc.*
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule . /wp-login.php?redirect_to=%{REQUEST_URI} [L]
    RewriteRule ^index\\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    # BEGIN s2Member GZIP exclusions
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\\?|&)s2member_file_download\\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\\?|&)no-gzip\\=1
    RewriteRule .* - [E=no-gzip:1]
    </IfModule>
    # END s2Member GZIP exclusions
    

    1 个回复
    SO网友:AnthonyK

    我知道这是一段古老的历史,但这一次肯定需要一个答案,因为这是在谷歌上搜索这个问题时的第一次命中。

    您可能忘记启用rewrite Apache模块:

    在Apache中启用模块:

    a2enmod rewrite
    
    然后Apache重新启动-systemd 方法如下所示,因为这是您当前最可能在CentOS服务器上找到的方法:

    systemctl restart apache2
    

    结束

    相关推荐

    Migration Question

    我正在试图弄清楚,对于我计划的一个非常重要的迁移,我是否正确地理解了迁移过程。我目前以Add On 我个人帐户上的域。www.example.com</我已经在我的经销商WHM系统上使用相同的域名为他们创建了一个帐户。www.example.com</我已经将他们的所有文件从我的个人托管帐户复制到我的HD</我会留下他们的MySQL DB和MySQL DB用户帐户,以防出现任何问题</我已经为他们的数据库创建了一个备份</现在据我所知,我所要做的就是:移除Add On 我个人