Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Przekierowanie 301 nieistniejącego katalogu na plik
Forum PHP.pl > Forum > Serwery WWW
amii
Potrzebuje zrobić przekierowanie z nieistniejącego: http://domena.pl/cgi-bin/wirtualnytester.cgi
na: http://domena.pl/alkomat.html

Takie coś nie działa:
RewriteRule ^alkomat\.html$ http://domena.pl/cgi-bin/wirtualnytester.cgi [R=301,L]
thek
Przecież reguła jest na odwrót smile.gif
RewriteRule PASUJĄCY_WZORZEC GDZIE_PRZEKIEROWAĆ [R=301,L]
amii
No niestety :/ tak też nie smiga:
RewriteRule ^cgi-bin\/wirtualnytester\.cgi$ /alkomat.html [R=301,L]

Poniżej .htaccess i link:
http://alkomat.biz/cgi-bin/wirtualnytester.cgi

Cytat
RewriteEngine On
RewriteBase /

# Przekierowanie z bez www na z www
RewriteCond %{HTTP_HOST} ^alkomat.biz$
RewriteRule ^(.*) http://www.alkomat.biz/$1 [QSA,L,R=301]

# Testy porownawcze
RewriteRule ^testy\.html$ testy.php

# FAQ
RewriteRule ^kontakt\.html$ kontakt.php

# FAQ
RewriteRule ^faq\.html$ faq.php

# Sprawdz sie on-line
RewriteRule ^alkomat\.html$ alkomat.php
RewriteRule ^refleksomierz\.html$ refleksomierz.php
RewriteRule ^kluczyk\.html$ kluczyk.php

# Mapa
RewriteRule ^mapa\.html$ mapa.php

# Wyszukiwarka
RewriteRule ^szukaj\.html$ szukaj.php

# Aktualnosci
RewriteRule ^aktualnosci\.html$ aktualnosci.php
RewriteRule ^aktualnosci/([0-9]+),([_a-zA-Z0-9]+)\.html$ aktualnosci.php?id=$1

# Nowosci
RewriteRule ^nowosci\.html$ nowosci.php
RewriteRule ^nowosci/([0-9]+),([_a-zA-Z0-9]+)\.html$ nowosci.php?id=$1

# Promocje
RewriteRule ^promocje\.html$ promocje.php
RewriteRule ^promocje/([0-9]+),([_a-zA-Z0-9]+)\.html$ promocje.php?id=$1

# Produkty
RewriteRule ^produkty\.html$ produkty.php
RewriteRule ^alkomaty\.html$ produkty.php
RewriteRule ^alkomaty/([0-9]+),([0-9]+),([_a-zA-Z0-9]+)\.html$ produkty.php?idk=$1&strona=$2
RewriteRule ^alkomaty/([0-9]+),([_a-zA-Z0-9]+)\.html$ produkty.php?idk=$1
RewriteRule ^alkomat/([0-9]+),([_a-zA-Z0-9]+)\.html$ produkty.php?id=$1

# Sondy
RewriteRule ^sondy\.html$ sondy.php
RewriteRule ^sondy/([0-9]+),([_a-zA-Z0-9]+)\.html$ sondy.php?id=$1
RewriteRule ^sondy/([0-9]+),([_a-zA-Z0-9]+)\.html?glosuj=1$ sondy.php?id=$1&glosuj=1

# Podstrony
RewriteRule ^index\.html$ index.php
RewriteRule ^([0-9]+),0,([_a-zA-Z0-9]+)\.html$ index.php?idd=$1
RewriteRule ^([0-9]+),([0-9]+),([_a-zA-Z0-9]+)\.html$ index.php?idd=$1&id=$2

# Stre podstrony 404
RewriteRule ^cgi-bin\/wirtualnytester\.cgi$ /alkomat.html [R=301,L]
Redirect 301 /testery/jakzamawiac.html http://alkomaty.biz/testery/jakzamawiac.php
Redirect 301 /testery/wirtualny.html http://www.alkomaty.biz/testery/wirtualny.html
Redirect 301 /klucz.html http://alkomaty.biz/alkosymulator_kluczyk
Redirect 301 /klucz.htm http://alkomaty.biz/alkosymulator_kluczyk
thek
Podnieś sobie poziom logów dla rewrite i zobacz gdzie i jak przekierowania idą. Bodajże RewriteLog smile.gif
amii
DOCUMENT_ROOT = /var/www/vhosts/alkomat.biz/httpdocs
Plik dostępny jako: alkomat.biz/rewrite.log

Daje w .htaccess

RewriteEngine On
RewriteLog "/var/www/vhosts/alkomat.biz/httpdocs/rewrite.log"
RewriteLogLevel 5
RewriteBase /

W efekcie dostaje 500 Internal Server Error
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.