doudao1950 2016-04-25 18:27
浏览 35

复制安装后,Wordpress wp登录不可用

First: I know that this question is existing in many variations and that there have been many answers but none of the solutions worked for me.

I have a working instance of WP running on my server, but I want to work on a new design and parallel run the old site. So I created a new subfolder neu on my server and copied all the WP-Files I had in this folder. I Also created a new database and imported my old database-file via sql inside the new database. Before I have imported the sql file I used the search/replace function in my editor and replaced www.myurl.de/ with www.myurl.de/neu/. I changed the data in the wp-config file and added

define('WP_HOME','example.com');
define('WP_SITEURL','example.com');

to my wp-config.

When I go to the new site i can open the front end sites, but when I try to go to the login page I get a 404.

So I am wondering what else could be the problem. The only thing that I noticed is that when I go to my database with phpMyAdmin and open the wp_options table, the siteurl is www.usersite6.de, but in the original installation it's the same, so I guess that this won't be the problem.

the site is: http://www.nrc-makler.de or http://www.nrc-makler.de/neu

  • 写回答

1条回答 默认 最新

  • dongtaijiao7140 2016-04-29 10:29
    关注

    I decided to create a new subdirectory and do everything from scatch again, because in my try before I did everything just "somehow" "somewhere". Now it works for me, so here is what I did, if somebody has the same problem.

    1. Copied the files to new subfolder
    2. created new DB and imported my "old" DB
    3. used SQL to update the urls in my new DB

    UPDATE wp_options SET option_value = replace(option_value,'old-url','new-url') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET post_content = replace(post_content,'old-url','new-url'); UPDATE bmccmps7_postmeta SET meta_value = replace(meta_value,'old-url','new-url');

    1. updated htaccess

      # BEGIN WordPress
      

      RewriteEngine On RewriteBase /new-subdirectory/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /new-subdirectory/index.php [L]

    2. added relocate function to my wp-config (right before the "That's all, stopp editing!"-line

      define('RELOCATE',true);

    3. Logged in to www.new-url/wp-login with old user data - and it wordked for me

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大