Admin login gets redirected
-
https://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz.in%2Fwp-admin%2F&reauth=1
This kind of loop is created.
When i setup wordpress then my domain was xyz.com for example then i moved to xyz.in. Since then i noticed this kind of redirect.Anyone has got any idea how to correct it.
-
Hi Avtar876,
This looks like a normal login page link to me, but it sounds like you’re in a loop, eh?
When i setup wordpress then my domain was xyz.com for example then i moved to xyz.in. Since then i noticed this kind of redirect.
How, exactly, did you move your domain from xyz.com to xyz.in?
Yes its kind of loop..
Actually when i had installed wordpress i entered xyz.com as domain name. I was hosting it with godaddy, I was interested in changing domain so through their hosting manager i changed to xyz.in(since both domain are also registered with godaddy, i selected xyz.in from the drop down option. Pretty simple).
Afterthat i was visiting xyz.in/wp-admin url was changing to this
https://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz.com%2Fwp-admin%2F&reauth=1Then i moved my website to other hosting, i had to change database, so in database i replaced all xyz.com to xyz.in
Now when i visit wp-admin, url changes to
https://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz.in%2Fwp-admin%2F&reauth=1So can you or anyone help me solve this.
My wordpress app is also not able to connect to wp-adim after host migration, it opens wp-login. I deleted the account & saved it again but no success.Open PHP MYADMIN > Go to xyz.com Database and in wp-option table change xyz.com to xyz.in , xyz.com is mention in 2 place edit both place carefully.
@bukge
I have already replaced xyz.com to xyZ.in completely from my database before migrating to new host.
I think some kind of redirection code is inserted somewhere.Earlier it was redirecting to xyz.com but now since i have replaced all xyz.com to xyz.in in my database. Its creating a loop.
Please reply if anybody has any solution..
Thanx in advanceI have already replaced xyz.com to xyZ.in completely from my database before migrating to new host.
How, exactly did you do this?
Do you still have access to a working version of the site on the old host, or is it borked too because of your domain change?
I think some kind of redirection code is inserted somewhere.
I’m guessing not, but it would be worth checking your .htaccess file to see what it contains. It’s always possible that there’s something in there interfering.
Do you have any caching on your new host? If so, I’d completely purge the cache.
@eric
By using razor sql i replaced all xyz.com to xyz.in from my database & uploaded it to phpmyadmin of my new host.I have w3tc installed & .htaccess is also clean.
Avtar976,
W3 Total Cache may have made changes to your .htaccess file and also, potentially, your wp-config.php file. I’d recommend:
- Backing both files up (maybe copy to htaccess.bak and wp-config.bak)
- Opening the original files and look for any special non-standard entries and remove them, or comment them out.
- Try to reload your dashboard and login
W3 Total Cache may have entries in your wp-config.php that look similar to this:
/** Enable W3 Total Cache */ define('WP_CACHE', true); // Added by W3 Total Cache // Enable the WordPress Object Cache: define(ENABLE_CACHE, true);
I’d comment the define lines out by prefacing them with a
//
.W3 Total Cache may have also added lines to your .htaccess similar to this:
# BEGIN W3 Total Cache <IfModule mod_setenvif.c> SetEnvIfNoCase Accept-Encoding (gzip) APPEND_EXT=.$1 </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} \/$ RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register).php|feed|wp-.*\.php|index\.php) [OR] RewriteCond %{REQUEST_URI} (wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php) [NC] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} ="" RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in) [NC] RewriteCond %{HTTP_USER_AGENT} !(bot|ia_archive|slurp|crawl|spider) [NC] RewriteCond /var/www/html/finance/cfodailynews/wp-content/w3tc/pgcache/$1/_default_.html%{ENV:APPEND_EXT} -f RewriteRule (.*) wp-content/w3tc/pgcache/$1/_default_.html%{ENV:APPEND_EXT} [L] </IfModule> # END W3 Total Cache
I’d remove all of this stuff during troubleshooting and leave only:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
You might also try (if you haven’t already) deactivating all of your plugins. If you can’t login to WP, you can’t do it the traditional way, but if you can access files on your server, temporarily rename the wp-content/plugins directory to something different (I use wp-content/_plugins). Then reload the login and see if it helps.
Depending on your site’s settings, it’s possible you may also have something cached in your browser, so you might wish to clear history, try another browser, or use private browsing mode to test.
Good luck!
BTW – I’m not suggesting you ditch W3 Total Cache permanently, but it can definitely get in the way of troubleshooting, so I’d disable it entirely until you get back into your site.
Then, you can decide if you’d like to reconfigure it.
@eric
My .htaccess file is this# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.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_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
</IfModule>
# END W3TC Browser Cache
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* – [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* – [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =””
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond “%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” -f
RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” [L]
</IfModule>
# END W3TC Page Cache core
# 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 WordPressHi Avtar876,
Per my prior message, I’d back up your .htaccess and edit it to remove all the W3TC info, so it looks like this instead:
# 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
There’s no use keeping the caching active if you can’t even login.
You might also look to see if you have an object-cache.php file in your wp-content folder and, if so, rename it to disable. Or, delete it. I think W3TC would re-add it when you reactivate the plugin after you’re back in.
There’s no use keeping the caching active if you can’t even login.
I am able to login. There is no problem in login. Though from wordpress app i am not able to login as wp-admin.
Although all functions like new post, page, comment moderation are working from app too.I must admit, I’m now confused.
I am able to login. There is no problem in login. Though from wordpress app i am not able to login as wp-admin.
I thought you couldn’t login and were in a loop – did I miss something? Which WordPress app, specifically?
Are you saying that the site works just fine now, but you can’t administer it through an external app?
- The topic ‘Admin login gets redirected’ is closed to new replies.