但是,在设置本地环境并尝试访问以下内容后,我正在尝试运行本地版本的live Wordpress站点:
http://localhost/wordpress/
我收到以下错误:
This webpage has a redirect loop
The webpage at http://localhost/wordpress/ has resulted in too many redirects.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
虽然我无法访问该网站,但我可以访问本地网站的仪表板,网址为:
http://localhost/wordpress/wp-admin/
我已经尝试修复这个问题好几个小时了,另一位wordpress专家(他已经运行了同一个站点的本地版本)花了2个小时与我一起对此进行哈希处理。没有运气。如果有任何帮助,我将不胜感激。希望是有用的背景:
为了运行本地版本,我安装了MAMP,MySQL和Apache服务器都是绿色的。我已经在MAMP/htdocs/wordpress中放置了所有站点文件的副本。我已将站点数据库导出为。sql文件,在通过MAMP加载的phpmyadmin页面中创建了一个新数据库,并导入了。sql文件。
我还更新了配置。php文件包含以下详细信息:
define(\'DB_NAME\', \'database_name\');
/** MySQL database username */
define(\'DB_USER\', \'root\');
/** MySQL database password */
define(\'DB_PASSWORD\', \'root\');
/** MySQL hostname */
define(\'DB_HOST\', \'localhost\');
/** Database Charset to use in creating database tables. */
define(\'DB_CHARSET\', \'utf8\');
/** The Database Collate type. Don\'t change this if in doubt. */
define(\'DB_COLLATE\', \'\');
我还通过SQL查找和替换语句更改了所有wordpress URL以运行localhost:80/wordpress。
我的htaccess文件包含以下内容:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php/$1 [NC,L,QSA]
</IfModule>
# END WordPress
尝试查看时,所有这些设置都会产生错误
如果任何人需要任何进一步的信息或以上任何信息不清楚,我将很乐意提供。提前感谢您的帮助。