Title: How to stop localhost from redirecting to https
Last modified: February 20, 2023

---

# How to stop localhost from redirecting to https

 *  [gunkev](https://wordpress.org/support/users/gunkev/)
 * (@gunkev)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/)
 * I have two local website that I having been working on. Everything was working
   well but somehow when I run myserver and try to asses my site’s dashboard via
   localhost/gandt/wp-admin it redirects to https. I have checked only andit’s due
   to a one of the website with HTTP Strict Transport Security.
 * I have tried some recommendated solutions to disable but it seems to not work
    1. I went to `chrome://net-internals/#hsts`and deleting `localhost` and `127.0.0.1`
    2. Empty Cache and Hard Reload ([https://galaxyinternet.us/google-chrome-redirects-localhost-to-https-fix/](https://galaxyinternet.us/google-chrome-redirects-localhost-to-https-fix/))
    3. removing cached images and files in `chrome://settings/clearBrowserData`
    4. Checking the `disable cache` in Chrome developer tools> network tab.
 * nothing seems to work. Please can anyone help?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16492756)
 * Was this site cloned from a production site? Review the installation’s .htaccess
   file and comment out any rules that redirect or rewrite to [https://](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/?output_format=md).
   Also comment out any header rules regarding Strict-Transport-Security:.
 * Be sure the site and home URLs in settings use http:// protocol. Consider using
   Better Search and Replace plugin to seek out any local https:// references in
   the DB and change them to [http://](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/?output_format=md).
 * It’s also possible to set Strict-Transport-Security: headers from Apache config
   files or the server’s virtual host file. I suppose some sort of WP security plugin
   could also be responsible for the header. Where ever it comes from, disable it.
 *  [Yabesh Photography](https://wordpress.org/support/users/yabeshphotographycoimbatore/)
 * (@yabeshphotographycoimbatore)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16505450)
 * If you’re running WordPress on your local development environment and it’s automatically
   redirecting to HTTPS, you can try the following steps to stop the redirect:
   Check
   your WordPress settings: Log in to your WordPress dashboard and go to Settings
   > General. Make sure that both the “WordPress Address (URL)” and “Site Address(
   URL)” fields start with “[http://&#8221](http://&#8221); and not “[https://&#8221](https://&#8221);.
   If they start with “[https://&#8221](https://&#8221);, change them to “[http://&#8221](http://&#8221);
   and save the changes.Disable any HTTPS-related plugins: If you’re using a plugin
   that forces HTTPS, try disabling it temporarily to see if it’s causing the redirect.
   You can also check if there are any HTTPS-related settings in your plugins and
   disable them if necessary.Check your .htaccess file: If you’re using Apache as
   your web server, check your .htaccess file in the root directory of your WordPress
   installation. Look for any lines that redirect to HTTPS and comment them out 
   or remove them. Make sure to create a backup of the file before making any changes.
   Check your SSL/TLS settings: If you’re using a tool like XAMPP or MAMP to set
   up your local development environment, make sure that SSL/TLS is not enabled.
   If it is, disable it and restart your web server.By following these steps, you
   should be able to stop localhost from redirecting to HTTPS in WordPress. If you’re
   still experiencing issues, you may want to consult the documentation for your
   web server or development environment for additional troubleshooting steps.
    -  This reply was modified 3 years, 3 months ago by [Yabesh Photography](https://wordpress.org/support/users/yabeshphotographycoimbatore/).
    -  This reply was modified 3 years, 3 months ago by [Yabesh Photography](https://wordpress.org/support/users/yabeshphotographycoimbatore/).
    -  This reply was modified 3 years, 3 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Thread Starter [gunkev](https://wordpress.org/support/users/gunkev/)
 * (@gunkev)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16509195)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/) and [@yabeshphotographycoimbatore](https://wordpress.org/support/users/yabeshphotographycoimbatore/)
   I can’t even login in my local website. Each time I type localhost/mywebsite/
   wp-admin, I am redirected to https. I have checked my .htaccess file there is
   no https configuration. I equally checked httpd-ssl.conf and httpd.conf. There
   is no https configuration. I am using XAMPP.
 * Everything was working perfectly but after putting my website online, the localhost
   website redirects to the online version. I don’t want to edit the online version
   directly.
 *  [Yabesh Photography](https://wordpress.org/support/users/yabeshphotographycoimbatore/)
 * (@yabeshphotographycoimbatore)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16510044)
 * To fix this issue, you can try the following steps: 1. Check if mod_rewrite is
   enabled in your XAMPP installation. It should be enabled for the localhost version
   of the website to work. You can enable it by opening the XAMPP control panel 
   and click on the “Apache (httpd) Config” button. 2. Make sure that the WordPress
   address (URL) and the site address (URL) are correct in the WordPress settings.
   If they are not correct, you will get a redirect error. 3. Check your .htaccess
   file and make sure that there are no redirect rules that are redirecting the 
   localhost version to the online version. 4. Check the httpd-ssl.conf and httpd.
   conf file for any redirect rules that may be redirecting the localhost version
   to the online version. 5. Try clearing the browser’s cache and cookies and then
   try to access the localhost version of the website. I hope this helps. If you
   are still having issues, you may need to reach out to your web hosting provider
   for further assistance.
 *  Thread Starter [gunkev](https://wordpress.org/support/users/gunkev/)
 * (@gunkev)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16510505)
 * [@yabeshphotographycoimbatore](https://wordpress.org/support/users/yabeshphotographycoimbatore/)
   I have tried all those methods none seems to be working.
 *  [Amjad Shuvo](https://wordpress.org/support/users/amjadshuvo/)
 * (@amjadshuvo)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16628336)
 * You can do the full installation again or re-install wordpress. Cause in localhost
   your page will come when you goto localhost only. It will automatically redirect
   to the working directory.
    1. Reinstall wordpress in XAMPP. OR
 * 2. Uninstall current XAMPP. Remove all folder and then install XAMPP again. Then
   install wordpress.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How to stop localhost from redirecting to https’ is closed to new replies.

## Tags

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

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 6 replies
 * 4 participants
 * Last reply from: [Amjad Shuvo](https://wordpress.org/support/users/amjadshuvo/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/how-to-stop-localhost-from-redirecting-to-https/#post-16628336)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
