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

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

报告相同问题?

悬赏问题

  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元