How can I fix 302 Found error?

Hello there,

My some end-users getting 302 Found response page while trying to access my forum, which is powered by Invision Power Suite. I tried to troubleshoot with CURL about what is the problem, these are the results:

And this is the .htaccess of the root directory (/var/www/html/)

It seems, my server is giving 302 response everytime user tries to access it through non-SSL. I don’t want to give up from security, so I have to find a way without disabling SSL.

HSTS is enabled, and my forum uses HTTPS address as the main board URL. I couldn’t find a proper solution in the internet, so I wanted to ask DigitalOcean community.


Note: Apache is 2.4.20, PHP is 7.0.8 (both from packages) and MySQL is 5.7.12 (Ubuntu packages)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

when i add this code site show ERR_TOO_MANY_REDIRECTS and when i remove this my site show unreachble plz help help

```code`````` To read more about my erotic and adult blogs<br />Please visit <a href=“” ></a><br /><a href=“” >Escorts service in Ranchi</a> | <a href=“” >Call girls in Ranchi</a> | <a href=“” >Escorts in Ranchi</a> | <a href=“” >College escorts in Ranchi</a> | <a href=“” >High profile escorts in Ranchi</a> | <a href=“” >VIP call girls in Ranchi</a> | <a href=“” >Independent escorts in Ranchi</a> | <a href=“” >Housewife escorts in Ranchi</a> | <a href=“” >Celebrity escorts in Ranchi</a> | <a href=“” >Air Hostess escorts in Ranchi</a> | <a href=“” >Actress escorts in Ranchi</a> | <a href=“” >Model escorts in Ranchi</a> | <a href=“” >Ranchi call girls</a> | <a href=“” >Ranchi escorts</a>


Can you clarify what the problem you’re running into is? A 302 response is a redirect. If you wish to use HTTPS for your site then this is a proper configuration. Having responses for http being a 302 redirect to the HTTPS version of the site rather than allowing browsing insecurely.