htaccess - How disable SSL redirect for specific URL?

admin2025-01-07  3

I have a specific URL that has to be accessible without SSL, so that some old devices can access it. The reason is those old devices have the URL hardcoded.

The URL is

My .htaccess looks like this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Redirect 301 /server 

However, the devices can't even access the first URL because it keeps redirecting to https://domain/server

I have a specific URL that has to be accessible without SSL, so that some old devices can access it. The reason is those old devices have the URL hardcoded.

The URL is http://domain.com/server

My .htaccess looks like this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Redirect 301 /server http://sub.domain.com/server

However, the devices can't even access the first URL because it keeps redirecting to https://domain.com/server

Share Improve this question asked Dec 18, 2019 at 12:51 Leon H.Leon H. 311 silver badge2 bronze badges 2
  • Do you have something like "automatic https redirect" setup in your hosting environment (Plesk, cPanel, etc.)? – kero Commented Dec 18, 2019 at 13:00
  • 2 There's nothing in your .htaccess file that triggers the HTTP to HTTPS redirect. You will need to either "fix" or disable the HTTP to HTTPS redirect elsewhere in your WordPress install. Only if you disable the redirect within WP itself would you then be able to implement the redirect in .htaccess, otherwise you'll get a redirect loop. (The Redirect directive you posted is a "redirect loop" regardless, since it's unconditionally redirecting /server to /server.) – MrWhite Commented Dec 18, 2019 at 13:11
Add a comment  | 

1 Answer 1

Reset to default 0

Your URL http://domain.com/server should work without problems. Most likely you have activated an HTTPS redirection for your website.

You should check:

  1. If you have a security or other type of plugin that forces the HTTPS redirection and deactivate the redirection. (Most likely they will edit your .htaccess file in order to force the HTTPS)
  2. Check your .htaccess file for a custom snippet that forces the HTTPS redirection
  3. Check your Hosting Settings. The HTTPS Redirection might be activated from there.
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736258708a534.html

最新回复(0)