简体   繁体   中英

.htaccess HTTPS redirect with exceptions

I am looking for a .htaccess code to redirect HTTPS requests on a certain url/page to HTTP (without SSL, yes the otherway around).

Please help.

Enable mod_rewrite and .htaccess through httpd.conf (if not already enabled) and then put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{HTTPS} on
RewriteRule ^surf\.php$ http://%{HTTP_HOST}%{REQUEST_URI} [L,NC,R=301]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM