Is it possible to redirect specific pages of my website (using https) to http?

Viewed 42

Aim

I would like to redirect specific pages of my website to http.

Background

I have the following .htacess

Options All -Indexes
RewriteEngine On 
RewriteRule ^(.*)\.html $1\.php [L]
RedirectMatch ^/*$  https://**mydomain_name**/files/index.php   
Options +SymLinksIfOwnerMatch 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /files/error.php [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

which allows me to redirect everything to https (and this works nicely)

Question

Is it possible to redirect all pages having an address containing internal (https://mydomain_name/internal/) to http (and not https)?

1 Answers

Better we could keep condition NOT to process requests for URIs which contains inernal rather than first redirecting them to https and then move back to http for specifically mentioned URIs.

Options All -Indexes
RewriteEngine On 
RewriteRule ^(.*)\.html $1\.php [L]
RedirectMatch ^/*$  https://**mydomain_name**/files/index.php   
Options +SymLinksIfOwnerMatch 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /files/error.php [L]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/internal [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Related