Zgodnie z tematem mam do ustawienia przekierowanie w .htaccess jednej domeny z różnymi postaciami, zabezpieczeniem duplikacji stron *(np.: www.eintro.pl to samo www.eintro/index.html) czyli http://eintro.pl http://www.eintro.pl https://eintro.pl na https://www.eintro.pl Zawartość .htaccess RewriteEngine on RewriteBase / RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\.eintro\.pl$ [NC] RewriteRule ^(.*)$ https://www.eintro.pl/$1 [L,R=301] RewriteRule ^index\.html$ / [R=301,L] w teście https://httpstatus.io/ nie działa to prawidłowo: http://eintro.pl 301 → Error while fetching URL. 1 http://www.eintro.pl 301 → 200 1 https://eintro.pl Error while fetching URL. 0 https://www.eintro.pl 200
2 podejście na teraz wykonałem to z generatora: ____________________________________________________________________ RewriteEngine on # Redirect to www.eintro.pl RewriteBase / RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteRule ^index\.html$ / [R=301,L] # Same for HTTPS: RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # Ensure all directory URLs have a trailing slash RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\/$ RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] # Same for HTTPS: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\/$ RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] # Redirect to another domain eintro.pl. RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^(www\.)?eintro\.pl$ [NC] RewriteRule .* http://eintro.pl%{REQUEST_URI} [R=301,L] # Same for HTTPS: RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^(www\.)?eintro\.pl$ [NC] RewriteRule .* https://eintro.pl%{REQUEST_URI} [R=301,L] _________________________________________________________ i niestety błąd *(https://eintro.pl Error) oraz duplikacja 1 *(https://www.eintro.pl/ z http://www.eintro.pl/) http://eintro.pl 301 → 200 1 https://eintro.pl Error while fetching URL. 0 http://www.eintro.pl 200 0 https://www.eintro.pl 200 Czy mogę liczyć na małą pomoc? Pozdrawiam Grzegorz dir5@wp.pl
Wystawiłem zgłoszenie do przeanalizowania QA-53730 zapewne to jakiś mały błąd, no chyba że rozwiązaniem jest w/w odpowiedź quick213
Nadal: .htaccess jak poprawnie wykonać przekierowanie z http://, http//www.,https:// na https://www w teście https://httpstatus.io/ nie działa to prawidłowo https://eintro.pl: http://eintro.pl 301 → 301 → 200 2 http://www.eintro.pl 301 → 200 1 https://eintro.pl Error while fetching URL. 0 https://www.eintro.pl 200 RewriteEngine on # przekierowanie na strone www.eintro.pl RewriteBase / RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteRule ^index\.html$ / [R=301,L] # to samo dla HTTPS: RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # przekieruj do innej domeny eintro.pl. RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^(www\.)?eintro\.pl$ [NC] RewriteRule .* http://eintro.pl%{REQUEST_URI} [R=301,L] # to samo dla HTTPS: RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^(www\.)?eintro.pl$ RewriteRule ^(.*)$ https://www.eintro.pl/$1 [R=301,L]
Poczekajmy na odpowiedź w zgłoszeniu QA-53730, dodam tylko, że już niebawem umożliwimy korzystanie z reguł tworzonych w popularnych generatorach. Więcej informacji zapewne podamy niebawem.
Wg. sugestii jakie otrzymałem, konsola zwraca takie informacje. Warto by chyba było zacząć od analizy tego i poprawić wszystkie http. Wczytywanie mieszanej (niezabezpieczonej) prezentacyjnej treści „http://imgx.firmy.net/firmaPrzyjaznaInternautom.img?PBDNS” na zabezpieczonej stronie[Więcej informacji] www.eintro.pl Wczytywanie mieszanej (niezabezpieczonej) prezentacyjnej treści „http://s.st-firmy.net//gfx/stars/star005.png” na zabezpieczonej stronie[Więcej informacji] www.eintro.pl Numer sprawy: ZUIW-96560