How to terminate redirecting to https for my WordPress (sub directory)?

My main WordPress is working good.

But its sub directory (WordPress) is not working.

It is redirecting to https.

I need to have working sub directory WordPress.

But it is redirecting to and not working.

Please help this.

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.

Hello, @sungeeservice

Could you please let me know if you’re using Nginx or Apache? In Apache you need to set Allow Override to All under the secure virtual host at port 443.

The following code in the htaccess file allows to force https across the whole website except a specific folder:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !/webservice     [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}  [R=301,L]

So any request to http would go to https. However you still need to explicitly change requests to https on your specified folder to redirect to http, so added the following code after the above:

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} /webservice      [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Hope this helps

Regards, Alex