dpndp64206 2014-09-04 20:12
浏览 65
已采纳

将Wordpress多站点移动到子文件夹中的localhost

I recently mowed my website from www to localhost in a sub-folder so the site url looks like this : http://localhost/mysite/main

This is a WordPress mulsitite. Ive searchred and replaced db www.mysite.com -> localhost/mysite/main

There is my .htaccess

RewriteEngine On

RewriteBase /mysite/main/
RewriteRule ^index\.php$ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

in wp-config.php added the following

define('WP_DEBUG', false);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost/mysite/main');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

For some reason though I'm getting a webpage redirect loop.

No idea why!?

Thanks for you help in advance.

  • 写回答

1条回答 默认 最新

  • dougu2240 2014-09-04 20:25
    关注

    I think this is a www / non-www version of your site problem. Make sure you have used exactly localhost/mysite/main in your database and haven't missed anything in there.

    Also, manually review all the wp_x_options tables and look for three fields and edit them as needed:

    home siteurl fileupload_url If you are moving from subdomains to subfolders, or vice-versa, remember to adjust the .htaccess file and the value for SUBDOMAIN_INSTALL in your wp-config.php file accordingly. reference

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里