Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne]Mod rewrite http://www na https://www, htaccess
Malinaa
post
Post #1





Grupa: Zarejestrowani
Postów: 573
Pomógł: 6
Dołączył: 21.07.2008

Ostrzeżenie: (0%)
-----


Jak dodać przekierowanie w .htaccess (Symfony)
ze starego adresu strony: http:/www.domena.pl/folder/
na adres: https://www.domena.pl/folder


Obecnie w pliku jest tak:

Kod
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
    RewriteRule .* - [E=BASE:%1]

    RewriteCond %{HTTP:Authorization} .+
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

    RewriteCond %{ENV:REDIRECT_STATUS} =""
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ %{ENV:BASE}/index.php [L]

</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 307 ^/$ /index.php/
    </IfModule>
</IfModule>


i kiedy klikam w Google na dowolny / każdy stary link zawsze przekierowuje na adres główny https://www.domena.pl
a chcę, aby przekierowywało z:
http:/www.domena.pl/folder/ na https:/www.domena.pl/folder
http:/www.domena.pl/folder/name.html na https:/www.domena.pl/folder/name.html
itd.


Ten post edytował Malinaa 29.09.2021, 23:07:39
Go to the top of the page
+Quote Post
vokiel
post
Post #2





Grupa: Zarejestrowani
Postów: 2 592
Pomógł: 445
Dołączył: 12.03.2007

Ostrzeżenie: (0%)
-----


Przekierowanie z HTTP na HTTPS (z przepisaniem całego URLa):

[APACHE] pobierz, plaintext
  1. RewriteCond %{HTTPS} off
  2. RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
[APACHE] pobierz, plaintext
Go to the top of the page
+Quote Post
Malinaa
post
Post #3





Grupa: Zarejestrowani
Postów: 573
Pomógł: 6
Dołączył: 21.07.2008

Ostrzeżenie: (0%)
-----


Już zrobione.

Ten post edytował Malinaa 30.09.2021, 12:45:27
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 16.09.2025 - 01:37