Title: Admin login gets redirected
Last modified: August 31, 2016

---

# Admin login gets redirected

 *  [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/)
 * `http://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.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/admin-login-gets-redirected/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/admin-login-gets-redirected/page/2/?output_format=md)

 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034657)
 * 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?
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034671)
 * 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 [http://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz](http://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz).**
   com**%2Fwp-admin%2F&reauth=1
 * Then 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
    [http://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz](http://www.xyz.in/wp-login.php?redirect_to=http%3A%2F%2Fwww.xyz).**
   in**%2Fwp-admin%2F&reauth=1
 * So 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.
 *  [Vishnu](https://wordpress.org/support/users/bukge/)
 * (@bukge)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034673)
 * 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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034674)
 * [@bukge](https://wordpress.org/support/users/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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034675)
 * 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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034829)
 * Please reply if anybody has any solution..
    Thanx in advance
 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034830)
 * > I 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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034831)
 * [@eric](https://wordpress.org/support/users/eric/)
    By using razor sql i replaced
   all xyz.com to xyz.in from my database & uploaded it to phpmyadmin of my new 
   host.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034832)
 * I have w3tc installed & .htaccess is also clean.
 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034833)
 * Avtar976,
 * W3 Total Cache may have made changes to your .htaccess file and also, potentially,
   your wp-config.php file. I’d recommend:
    1. Backing both files up (maybe copy to htaccess.bak and wp-config.bak)
    2. Opening the original files and look for any special non-standard entries and
       remove them, or comment them out.
    3. 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!
 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034834)
 * 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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034835)
 * [@eric](https://wordpress.org/support/users/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 WordPress
 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034836)
 * Hi 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.
 *  Thread Starter [Avtar876](https://wordpress.org/support/users/avtar876/)
 * (@avtar876)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034837)
 * > 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.
 *  [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * (@sewmyheadon)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/#post-7034838)
 * 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?

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/admin-login-gets-redirected/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/admin-login-gets-redirected/page/2/?output_format=md)

The topic ‘Admin login gets redirected’ is closed to new replies.

## Tags

 * [login loop](https://wordpress.org/support/topic-tag/login-loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 21 replies
 * 3 participants
 * Last reply from: [Eric Amundson](https://wordpress.org/support/users/sewmyheadon/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/admin-login-gets-redirected/page/2/#post-7034851)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
