Перенаправление в моем .htaccess на https не работает - PullRequest
0 голосов
/ 02 апреля 2019

У меня есть .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteRule cache/ - [F]
Options -Indexes

RewriteCond %{HTTP_HOST} ^www.domains.eu [NC]
RewriteRule ^(.*)$ https://domains.eu/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-zA-Z0-9\-\_\/]*)$ index.php?p=$1


# Blokada hotlinking czyli kradzieży obrazków
RewriteCond %{HTTP_REFERER} !^https://(.+\.)?domains.pl/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
#RewriteRule .*\.(jpe?g|jpg|gif|bmp|png|jpeg)$ - [F]

#AuthType Basic
#AuthName "Password Protected Area"
#AuthUserFile /home/webplay/domains/domains.eu/public_html/.htpasswd
#Require valid-user



# Prevent viewing of htaccess file.
<Files .htaccess>
    order allow,deny
    deny from all
</Files>
RedirectMatch 403 ^.*/apps/(.*).php(.*)$

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl|map)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

Мне нужно следующее перенаправление ::

  • перенаправление с http: // domains .pl, http: //www.domains .pl, https: //www.domains .pl, https: // domains .pl to https: // domains .eu

  • перенаправить с https: // www.domains .eu, http: //www.domains .pl, http: // domains .eu, https: // domains .eu

Могу ли я попросить помощи у моего.htaccess сделал в эти перенаправления?

1 Ответ

1 голос
/ 02 апреля 2019

Пожалуйста, добавьте ниже код и протестируйте его?

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://domains.eu/$1 [L,R=301]
...