• Resolved r_zo

    (@r_zo)


    I just moved my website from a virtual server to a dedicated server.
    The website works, but i can’t login to the admin panel because i am seeing a redirect loop problem.
    I tried everything on the first 10 google results, nothing worked.

    I added these to wp-config.php:
    define(‘WP_HOME’,’https://showviral.com’);
    define(‘WP_SITEURL’,’https://showviral.com’);

    I cleared my cookies/cache from my browser.
    I renamed the plugins folder to disable the plugins.

    Any suggestions?
    Thanks for your time

Viewing 12 replies - 1 through 12 (of 12 total)
  • Can you rename your .htaccess to .htaccess.old and try?

    Thread Starter r_zo

    (@r_zo)

    Doing that is giving me a 500 Internal Server Error.
    Is there any particular line inside that you think i should change instead?

    Can you show me the Redirect code you are using in .htaccess?

    If you are using cpanel, then remove the URL redirect from your cpanel.

    Thread Starter r_zo

    (@r_zo)

    There are no redirects in cpanel.

    #WFIPBLOCKS – Do not remove this line. Disable Web Caching in Wordfence to remove this data.
    Order Deny,Allow
    #Do not remove this line. Disable Web Caching in Wordfence to remove this data – WFIPBLOCKS
    #WFCACHECODE – Do not remove this line. Disable Web Caching in Wordfence to remove this data.
    <IfModule mod_deflate.c>
    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_headers.c>
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_mime.c>
    AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
    </IfModule>
    <IfModule mod_mime.c>
    AddType text/html .html_gzip
    AddEncoding gzip .html_gzip
    AddType text/xml .xml_gzip
    AddEncoding gzip .xml_gzip
    </IfModule>
    <IfModule mod_setenvif.c>
    SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip
    SetEnvIfNoCase Request_URI \.xml_gzip$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    Header set Vary “Accept-Encoding, Cookie”
    </IfModule>
    <IfModule mod_rewrite.c>
    #Prevents garbled chars in cached files if there is no default charset.
    AddDefaultCharset utf-8

    #Cache rules:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} on
    RewriteRule .* – [E=WRDFNC_HTTPS:_https]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* – [E=WRDFNC_ENC:_gzip]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{HTTPS} off
    RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$
    RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]

    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]

    RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$
    RewriteCond “%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}” -f
    RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ “/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}” [L]
    </IfModule>
    #Do not remove this line. Disable Web caching in Wordfence to remove this data – WFCACHECODE
    # 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>
    # END WordPress

    Remove (for temporary time, copy to a text file to your hard drive) the following codes from your .htaccess file:

    #Cache rules:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} on
    RewriteRule .* - [E=WRDFNC_HTTPS:_https]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=WRDFNC_ENC:_gzip]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{HTTPS} off
    RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$
    RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]
    
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]
    
    RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" -f
    RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ "/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" [L]

    Additionally you can comment out as bellow:

    #Cache rules:
    #RewriteEngine On
    #RewriteBase /
    #RewriteCond %{HTTPS} on
    #RewriteRule .* - [E=WRDFNC_HTTPS:_https]
    #RewriteCond %{HTTP:Accept-Encoding} gzip
    #RewriteRule .* - [E=WRDFNC_ENC:_gzip]
    #RewriteCond %{REQUEST_METHOD} !=POST
    #RewriteCond %{HTTPS} off
    #RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$
    #RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]
    
    #RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]
    
    #RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$
    #RewriteCond "%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" -f
    #RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ "/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" [L]

    Thread Starter r_zo

    (@r_zo)

    I did that, no luck.

    r_zo,

    Which one you did? Can you tell?

    Can you remove everything from .htaccess and include the following:

    # 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>
    # END WordPress

    This is what a Default WordPress .htaccess should be.

    Thread Starter r_zo

    (@r_zo)

    What i meant before when i said “I did that, no luck”, was that i commented out those lines.

    Then i also took out everything except those lines you mentioned and still no luck. I am losing hope. I have no idea what else could be causing this.

    See the above reply I have given.

    Redirect loop only cause by malfunctioning of .htaccess coding.

    Your .htaccess is clearly saying that you are continuing the HTTP & HTTPS redirect. Hence simply use the default WordPress .htaccess.

    Hence follow with the suggestion given just above your response.

    Thread Starter r_zo

    (@r_zo)

    Right. Btw, i appreciate your help a lot.

    This is what my htaccess has inside right now.
    # 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>
    # END WordPress

    That’s it.
    But it still isn’t working.
    I don’t have any www redirects in cpanel either.
    The website is loading fine, its just the admin panel, which is odd.

    Updating your .htaccess doesn’t work quickly. You need to wait for few minutes or seconds.

    By this time I see that the redirect loop is fixed.

    Thread Starter r_zo

    (@r_zo)

    The problem got fixed when i put the folder permission for wp-admin to 755 instead of 775… go figure.
    Anyway, thanks a lot for your help Dhruba! ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Redirect Loop on admin login page’ is closed to new replies.