定义('多站点',真);导致 Wordpress 3.0 中的重定向过多 [英] define( 'MULTISITE', true ); causes too many redirects in Wordpress 3.0
问题描述
我正在尝试通过 MAMP 在 Mac 的本地主机上为 wordpress 3.0 设置多站点功能.
I'm trying to setup the multisite feature for wordpress 3.0 on my Mac's localhost via MAMP.
当我按照通过子目录或子域打开网络的所有说明进行操作时,无论哪种方式,我都会得到
When I follow all the instructions for turning on networking via subdirectory or subdomain, either way, I get
Safari 无法打开页面.尝试打开http://localhost:80/"时发生了太多重定向.如果您打开的页面被重定向以打开另一个页面,然后又被重定向以打开原始页面,则可能会发生这种情况."
"Safari can’t open the page. Too many redirects occurred trying to open "http://localhost:80/". This might occur if you open a page that is redirected to open another page which then is redirected to open the original page."
我已经尝试了在论坛上能找到的所有内容:- 注释掉定义( 'DOMAIN_CURRENT_SITE', 'localhost:80' );线- 添加这一行定义('NOBLOGREDIRECT', 'http://localhost:80/');到 wp-config 文件-添加定义('日出','on');到 wp-config- 以各种方式调整 .htaccess 文件- 更改 MAMP 中的配置设置-清除cookies和缓存-添加定义('日出','on');- 我什至重新安装了 wp3.0 5 次,其中一次我将 wordpress 文件夹中的所有内容取出并直接转储到 htdocs 文件夹中,正如一篇论坛帖子所说的那样.
I've tried everything I could find on forums: -commenting out the define( 'DOMAIN_CURRENT_SITE', 'localhost:80' ); line -adding this line define('NOBLOGREDIRECT', 'http://localhost:80/'); to the wp-config file -adding define( 'SUNRISE', 'on' ); to the wp-config -tweaking the .htaccess file in various ways -changing configuration settings in MAMP -clearing cookies and the cache -adding define( 'SUNRISE', 'on' ); -I even reinstalled wp3.0 five different times and one of those times I took all the contents out of the wordpress folder and dumped them directly into the htdocs folder as one forum post said to do.
这些都没有奏效.我不知道这是否是使用 Mac 和使用 MAMP 的怪癖.这是该站点的基本 URL:http://localhost:80/我试过删除 :80 部分在 url 栏中,它被重定向回 (http://localhost:80/)这是我的 Mamp Apache 文档根路径:/Applications/MAMP/htdocs/(我试过这个有和没有尾部斜杠)
None of this has worked. I don't know if this is a quirk of using a Mac and using MAMP. Here is the base url for the site: http://localhost:80/ I've tried deleting out the :80 part in the url bar and it gets redirected back to (http://localhost:80/) Here is my Mamp Apache document root path: /Applications/MAMP/htdocs/ (I tried this with and without the trailing slash)
我做错了什么?
推荐答案
WordPress Multisite 将无法使用 URL 中的端口号(如 wp-includes/ms-setting.php
中所述).
WordPress Multisite will not work with the port number in the URL (as stated in wp-includes/ms-setting.php
).
如果您设置了 Apache VirtualHost,您将获得更好的成功, 例如;
You'll have much better success if you set up an Apache VirtualHost, for example;
<VirtualHost *:80>
DocumentRoot "/path/to/wordpress"
ServerName wordpress.dev
</VirtualHost>
您需要编辑 HOSTS 文件以指向 wordpress.dev
到 127.0.0.1
(您的本地 IP 地址).
You'll need to edit the HOSTS file to point wordpress.dev
to 127.0.0.1
(your local IP address).
这意味着您现在可以在地址栏中使用 http://wordpress.dev
- 由于服务器名称是标准域格式,WordPress MS 应该没有任何问题(这正是我如何运行我的设置).
This means you can now use http://wordpress.dev
in the address bar - since the server name is a standard domain format, WordPress MS shouldn't have any problems (this is exactly how I run my set-up).
这篇关于定义('多站点',真);导致 Wordpress 3.0 中的重定向过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!