Mam taki .htaccess:
Options +FollowSymLinks RewriteEngine on RewriteRule cache/ - [F] Options -Indexes RewriteCond %{HTTP_HOST} ^www.domains.eu [NC] RewriteRule ^(.*)$ <a href="https://domains.eu/$1" target="_blank">https://domains.eu/$1</a> [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 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>
Potrzebuję następujące przekierowania:
- przekierowanie z http ://domains .pl, http ://www.domains .pl, https ://www.domains .pl, https ://domains .pl do https ://domains .eu
- przekierowanie z https ://www.domains .eu, http ://www.domains .pl, http ://domains .eu, do https ://domains .eu
W jaki sposób zrobić to w .htaccess ?
Ok, poradziłem sobie.
Rozwiązanie:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://domain.eu/$1 [L,R=301]