If you’re trying to do some testing on your existing WordPress website locally (using something like XAMPP) using the same files and database but find that it keeps 302 redirecting to your website rather than running it locally, you will have to configure your WordPress options to set your home and site URL to your local address.
Since you can’t even access your WordPress admin interface because of the redirects, you’ll have to configure this on the backend, your database.
Run your trustworthy phpMyAdmin or your favourite SQL client, connect to your local database and browse to your WordPress database (this is usually prefixed with wp_). Then browse to a table called wp_options or wp_kicpl0_options and look for a table field called siteurl.
The current value of this field should be your website. Edit this field value to your local address (i.e. http://localhost/wordpress). Remember NOT to use a / at the end. Save this.
The next field to edit is called home. If you can’t find this field on your current view in phpMyAdmin, it’s probably on the next page of fields. Edit this field value to the same value you used in siteurl. Save this.
Once you’ve edited both fields, just simply type in your local address again in your browser and you should be running your website locally instead of being redirected to your online website.
Is this solution working for you with WordPress 2.7?
I’ve tried this solution and even though both SITEURL and HOME are changed in the database somehow it still (!) redirects to the website!
Any ideas why this might be so? I’ve cleared cache and cookies.
Yes, this solution worked for me.
You may want to check your htaccess file to make sure it’s all good there. If that doesn’t work, you might want to try the WordPress support forums. Seems like there’s been others experiencing similar problems as yours.