K
K
Konstantin2018-04-30 22:03:42
htaccess
Konstantin, 2018-04-30 22:03:42

How to make an https redirect exception for one page?

Please tell me how to set up a redirect. The whole site works on https, but I need to leave the http protocol for one page!
The admin set up and does not get in touch!
In .htaccess I have the following

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

  #del www
  RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    
  #del //
  RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
  RewriteRule (.*) %1/%2 [R=301,L] 
  
  #add /
  RewriteCond %{REQUEST_URI} ^(.*/[^/\.]+)$
  RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
  RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

I don't understand at all how a redirect to https is made here to add an exception.... It is
required that, for example, one page www.site.ru/razdel/file works without redirects using two protocols!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-05-02
@tyrepharm

there is no redirect to https
but it can be elsewhere
1. redirect to nginx
2. redirect to apache
3 settings of https itself, you can specify automatic redirect to https there
like this

add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: dat a:; font-src https: dat a:; report-uri /csp-report";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question