【问题标题】:WordPress wp-admin redirect to http://127.0.0.1/WordPress wp-admin 重定向到 http://127.0.0.1/
【发布时间】:2018-03-30 19:54:55
【问题描述】:

我有这个问题:当我尝试登录我的 WP 仪表板 (wp-admin) 时,它重定向到 127.0.0.1。

当我输入 websitename.com/wp-admin 时,它显示“无法连接”。

谁能帮忙?

我的网站根目录下的.htaccess 文件:

# BEGIN All In One WP Security
#AIOWPS_BLOCK_WP_FILE_ACCESS_START
<Files license.txt>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
<Files wp-config-sample.php>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
<Files readme.html>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
#AIOWPS_BLOCK_WP_FILE_ACCESS_END
#AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
ServerSignature Off
LimitRequestBody 10240000
<Files wp-config.php>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
#AIOWPS_BASIC_HTACCESS_RULES_END
#AIOWPS_PINGBACK_HTACCESS_RULES_START
<Files xmlrpc.php>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
#AIOWPS_PINGBACK_HTACCESS_RULES_END
#AIOWPS_DEBUG_LOG_BLOCK_HTACCESS_RULES_START
<Files debug.log>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>
#AIOWPS_DEBUG_LOG_BLOCK_HTACCESS_RULES_END
#AIOWPS_DISABLE_INDEX_VIEWS_START
Options -Indexes
#AIOWPS_DISABLE_INDEX_VIEWS_END
#AIOWPS_DISABLE_TRACE_TRACK_START
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
#AIOWPS_DISABLE_TRACE_TRACK_END
#AIOWPS_FORBID_PROXY_COMMENTS_START
RewriteCond %{REQUEST_METHOD} ^POST
RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_HOST} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule wp-comments-post\.php - [F]
#AIOWPS_FORBID_PROXY_COMMENTS_END
#AIOWPS_ENABLE_BRUTE_FORCE_PREVENTION_START
RewriteEngine On
RewriteCond %{REQUEST_URI} (wp-admin|wp-login)
RewriteCond %{QUERY_STRING} !(action\=postpass)
RewriteCond %{HTTP_COOKIE} !aiowps_secret= [NC]
RewriteCond %{HTTP_COOKIE} !aiowps_cookie_test_kzs9w240bq= [NC]
RewriteRule .* http://127.0.0.1 [L]
#AIOWPS_ENABLE_BRUTE_FORCE_PREVENTION_END
#AIOWPS_BLOCK_SPAMBOTS_START
<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} ^(.*)?wp-comments-post\.php(.*)$
    RewriteCond %{HTTP_REFERER} !^http(s)?://abc\.com [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule .* http://127.0.0.1 [L]
</IfModule>
#AIOWPS_BLOCK_SPAMBOTS_END
# END All In One WP Security

# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
    AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
# DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>
# END W3TC Browser Cache
# BEGIN WordPress
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

# END WordPress

【问题讨论】:

    标签: wordpress apache .htaccess


    【解决方案1】:

    此行用于在您自己的机器上开发:RewriteRule .* http://127.0.0.1 [L]

    用你的域名替换ip。

    【讨论】:

      【解决方案2】:

      看起来您正在使用 All In One WP Security 插件,现在已迁移到公共域。

      考虑更新插件的设置。

      【讨论】:

        【解决方案3】:

        将这两行添加到您的 wp-config.php,其中 "example.com" 是您网站的正确位置。

        define('WP_HOME','http://example.com');
        define('WP_SITEURL','http://example.com');
        

        【讨论】:

          【解决方案4】:

          解决这个问题:

          1. 登录到 phpmyadmin
          2. 转到 wordpress => wp_option
          3. option_name siteurlhome 编辑 option_value 以更正位置 IMG

          【讨论】:

            【解决方案5】:

            websitename.com/wp-admin 它显示“无法连接”。

            请检查您的网站主题设置以 从您的网站中删除 WordPress 版本元标记。

            【解决方案6】:

            您的问题将使用此代码解决。我给保证。感谢愉快的编码。

            add_filter('init', "set_cookie_func");

            函数 set_cookie_func(){

            $secure = ('https' === parse_url(wp_login_url(), PHP_URL_SCHEME)); setcookie( TEST_COOKIE, 'WP Cookie 检查', 0, '/nextcore-media-support/', COOKIE_DOMAIN, $secure ); setcookie('LETMEIN', 'OK', 0, '/', COOKIE_DOMAIN, $secure );

            如果 ( SITECOKIEPATH != COOKIEPATH ){

            setcookie(TEST_COOKIE, 'WP Cookie 检查', 0, '/nextcore-media-support/', COOKIE_DOMAIN, $secure ); setcookie('LETMEIN', 'OK', 0, '/', COOKIE_DOMAIN, $secure );

            }

            }

            【讨论】:

            • 您必须编辑项目的某些部分要求。
            猜你喜欢
            • 2012-05-21
            • 1970-01-01
            • 1970-01-01
            • 2019-04-26
            • 2015-09-21
            • 2017-07-14
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多