重定向301 - 尝试将链接从旧页面asp重定向到新页面php

时间:2014-02-04 17:47:32

标签: php asp.net .htaccess redirect

我尝试将我在Google上擅长的旧链接重定向到我的新php网站。我尝试使用Redirect 301,但没有运气,尝试使用和不使用站点域但没有运气。一路引导我到起始页面。我不知道这是一个问题,因为旧页面是.asp? http://www.dalmaturist.hr/

      Options -Indexes

RewriteEngine on

RewriteRule ^hrv/ponuda/izleti.asp /hr/izleti [L,R=301]
RewriteRule ^hrv/kontakti/karta.asp /hr/pakostane [L,R=301]
RewriteRule ^eng/offer/excursions.asp /en/excursions [L,R=301]

RewriteRule ^hrv/o_nama/index.asp /hr/najam-plovila/ [L,R=301]
RewriteRule ^hrv/ponuda/rent.asp /hr/najam-plovila/ [L,R=301]

RewriteCond %{QUERY_STRING} ^mjesto=1$
RewriteRule ^itravel/hrv/rezultati.asp$ /hr/smjestaj/? [L,R=301]

RewriteCond %{QUERY_STRING} ^mjesto=1&stranica=6$
RewriteRule ^itravel/deu/rezultati.asp$  /de/unterkunft/? [L,R=301]

RewriteCond %{QUERY_STRING} ^mjesto=1&stranica=2$
RewriteRule ^itravel/eng/rezultati.asp$ /en/accommodation/? [L,R=301]

RewriteCond %{QUERY_STRING} ^sifra_apartmana=12&view_date=01/6/2014$
RewriteRule ^itravel/deu/detalji.asp$ /de/bootscharter/? [L,R=301]

RewriteCond %{QUERY_STRING} ^sifra_apartmana=84&view_date=01/6/2013$
RewriteRule ^itravel/eng/detalji.asp$ /en/accommodation/? [L,R=301]

RewriteRule ^hr$ /index.php?lang=hr
RewriteRule ^en$ /index.php?lang=en
RewriteRule ^de$ /index.php?lang=de

## Hrvatski ##

RewriteRule ^hr/dalmaturist$ /dalmaturist.php
RewriteRule ^hr/placanja$ /placanja.php
RewriteRule ^hr/uvjeti$ /uvjeti.php
RewriteRule ^hr/smjestaj/(.*)$ /smjestaj.php?page=$1
RewriteRule ^hr/smjestaj_sortiranje$ /smjestaj_sortiranje.php
RewriteRule ^hr/objekt/(.*)/(.*)$ /smjestaj-objekt.php?SmjestajID=$1&SmjestajSeo=$2
RewriteRule ^hr/najam-plovila/(.*)$ /rent-boat.php?page=$1
RewriteRule ^hr/rent-boat_sortiranje$ /rent-boat_sortiranje.php
RewriteRule ^hr/brod/(.*)/(.*)$ /rent-boat-objekt.php?PloviloID=$1&PloviloSeo=$2
RewriteRule ^hr/izleti$ /izleti.php
RewriteRule ^hr/suvenirnica$ /suvenirnica.php
RewriteRule ^hr/pakostane$ /pakostane.php
RewriteRule ^hr/okruzenje$ /okruzenje.php
RewriteRule ^hr/kontakt$ /kontakt.php
RewriteRule ^hr/bicikli-skuteri$ /bike-scooter.php
RewriteRule ^hr/rezervacija$ /rezervacija.php
RewriteRule ^hr/thank-you$ /thank-you.php

## Engleski ##

RewriteRule ^en/dalmaturist$ /dalmaturist.php
RewriteRule ^en/payment$ /placanja.php
RewriteRule ^en/terms$ /uvjeti.php
RewriteRule ^en/accommodation/(.*)$ /smjestaj.php?page=$1
RewriteRule ^en/smjestaj_sortiranje$ /smjestaj_sortiranje.php
RewriteRule ^en/object/(.*)/(.*)$ /smjestaj-objekt.php?SmjestajID=$1&SmjestajSeo=$2
RewriteRule ^en/rent-boat/(.*)$ /rent-boat.php?page=$1
RewriteRule ^en/rent-boat_sortiranje$ /rent-boat_sortiranje.php
RewriteRule ^en/boat/(.*)/(.*)$ /rent-boat-objekt.php?PloviloID=$1&PloviloSeo=$2
RewriteRule ^en/excursions$ /izleti.php
RewriteRule ^en/souvenir-shop$ /suvenirnica.php
RewriteRule ^en/pakostane$ /pakostane.php
RewriteRule ^en/surroundings$ /okruzenje.php
RewriteRule ^en/contact$ /kontakt.php
RewriteRule ^en/bike-scooter$ /bike-scooter.php
RewriteRule ^en/reservation$ /rezervacija.php
RewriteRule ^en/thank-you$ /thank-you.php

## Njemački ##

RewriteRule ^de/dalmaturist$ /dalmaturist.php
RewriteRule ^de/wie-bezahlen$ /placanja.php
RewriteRule ^de/allgemeine-geschaftsbedingungen$ /uvjeti.php
RewriteRule ^de/unterkunft/(.*)$ /smjestaj.php?page=$1
RewriteRule ^de/smjestaj_sortiranje$ /smjestaj_sortiranje.php
RewriteRule ^de/objekt/(.*)/(.*)$ /smjestaj-objekt.php?SmjestajID=$1&SmjestajSeo=$2
RewriteRule ^de/bootscharter/(.*)$ /rent-boat.php?page=$1
RewriteRule ^de/rent-boat_sortiranje$ /rent-boat_sortiranje.php
RewriteRule ^de/boot/(.*)/(.*)$ /rent-boat-objekt.php?PloviloID=$1&PloviloSeo=$2
RewriteRule ^de/ausfluge$ /izleti.php
RewriteRule ^de/geschenkboutique$ /suvenirnica.php
RewriteRule ^de/pakostane$ /pakostane.php
RewriteRule ^de/umgebung$ /okruzenje.php
RewriteRule ^de/kontakt$ /kontakt.php
RewriteRule ^de/fahrrad-motorroller$ /bike-scooter.php
RewriteRule ^de/reservierung$ /rezervacija.php
RewriteRule ^de/thank-you$ /thank-you.php

ErrorDocument 401 http://www.dalmaturist.hr/
ErrorDocument 403 http://www.dalmaturist.hr/
ErrorDocument 404 http://www.dalmaturist.hr/

1 个答案:

答案 0 :(得分:1)

您无法匹配Redirect指令中的查询字符串。使用mod_rewrite规则:

RewriteCond %{QUERY_STRING} ^mjesto=1$
RewriteRule ^itravel/hrv/rezultati\.asp$ http://www.dalmaturist.hr/hr/smjestaj/? [L,R=301]

RewriteRule ^hrv/o_nama/index\.asp$ /hr/rent-boat/ [L,R=301]

并确保在其他重写规则之前将其放在顶部