Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML] .htaccess przekierowanie kontakt.html a /kontakt/
harbii
post 23.11.2019, 14:18:21
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 1
Dołączył: 27.05.2006

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


Witam. Mam taki problem:
Jeżeli zrobię takie przekierowanie:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^127.0.0.1/str
RewriteRule (.*) http://127.0.0.1/tozbel/ [R=301,L]
RewriteRule ^kontakt.html index.php?abc=455 [L]

Strona kontakt otwiera się bez problemu

Chciałbym jednak tak:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^127.0.0.1/str
RewriteRule (.*) http://127.0.0.1/tozbel/ [R=301,L]
RewriteRule ^/kontakt/ index.php?abc=455 [L]

Ale dostaję:
Additionally, a 404 Not Found

Ten post edytował harbii 23.11.2019, 14:21:02
Go to the top of the page
+Quote Post
Tomplus
post 24.11.2019, 14:44:36
Post #2





Grupa: Zarejestrowani
Postów: 1 828
Pomógł: 225
Dołączył: 20.03.2005
Skąd: Będzin

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


Usunąłem / z osatniej linii i działa:

Kod
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteCond %{HTTP_HOST} ^127.0.0.1/str
RewriteRule (.*) http://127.0.0.1/tozbel/ [R=301,L]
RewriteRule ^kontakt/ index.php?abc=455 [L]


Dodałem jeszcze dwie linie które są dosyć pomocne.

Jak coś warto korzystać z https://htaccess.madewithlove.be/ aby przetestować swój kod .htaccess.
Jak coś polecam kojrz
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 23:41