I이 몇 가지 규칙 containg 다음의 .htaccess :htaccess로 재 작성 복잡한 URL
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(.*?)(?:\+|%20|\s)+(.+?)\sHTTP [NC]
RewriteRule^/%1-%2 [L,NE,R=302]
RewriteRule ^([_&/A-Za-z0-9\s]+)-([&/A-Za-z0-9\s]+)-([&/A-Za-z0-9\s]+)-Photographers?$ html/photographers-10.cfm?county=$1&speciality=$2&address4=$3&rwtn [NC,L]
RewriteCond %{QUERY_STRING} !rwtn
RewriteCond %{QUERY_STRING} ^county=(.*)&speciality=(.*)&address4=(.*)
RewriteRule ^html/photographers-10\.cfm$ http://www.photographers.co.uk/%3-%2-Photographers? [R=301,L]
RewriteRule ^([_&/A-Za-z0-9\s]+)-Photographers/?$ html/photographers-4.cfm?county=$1&rwtn [NC,L]
RewriteCond %{QUERY_STRING} !rwtn
RewriteCond %{QUERY_STRING} ^county=(.*)
RewriteRule ^html/photographers-4\.cfm$ http://www.photographers.co.uk/%1-Photographers? [R=301,L]
RewriteRule ^([_&/A-Za-z0-9]+)-([&/A-Za-z0-9]+)-Photographers?$ html/photographers-5.cfm?county=$1&speciality=$2&rwtn [NC,L]
RewriteCond %{QUERY_STRING} !rwtn
RewriteCond %{QUERY_STRING} ^county=(.*)&speciality=(.*)
RewriteRule ^html/photographers-5\.cfm$ http://www.photographers.co.uk/%1-%2-Photographers? [R=301,L]
RewriteRule ^Canary-Wharf-London-Photographer/?$ html/photographers-9.cfm?address4=Canary-Wharf&county=London&rwtn [NC,L]
RewriteRule ^City-of%2520London-London-Photographer/?$ html/photographers-9.cfm?address4=City-of%20London&county=London&rwtn [NC,L]
RewriteRule ^East-London-London-Photographer/?$ html/photographers-9.cfm?address4=East-London&county=London&rwtn [NC,L]
RewriteRule ^Kingston-upon%2520Thames-London-Photographer/?$ html/photographers-9.cfm?address4=Kingston-upon Thames&county=London&rwtn [NC,L]
RewriteRule ^NOTTING-HILL-London-Photographer/?$ html/photographers-9.cfm?address4=NOTTING-HILL&county=London&rwtn [NC,L]
RewriteRule ^South-Woodford-London-Photographer/?$ html/photographers-9.cfm?address4=South-Woodford&county=London&rwtn [NC,L]
RewriteRule ^Stamford-Brook-London-Photographer/?$ html/photographers-9.cfm?address4=Stamford-Brook&county=London&rwtn [NC,L]
RewriteRule ^([_&/A-Za-z0-9\s]+)-([&/A-Za-z0-9\s]+)-Photographer/?$ html/photographers-9.cfm?address4=$1&county=$2&rwtn [NC,L]
RewriteCond %{QUERY_STRING} !rwtn
RewriteCond %{QUERY_STRING} ^address4=(.*)&county=(.*)
RewriteRule ^html/photographers-9\.cfm$ http://www.photographers.co.uk/%1-%2-Photographer/? [R=301,L]
나는 내 웹 사이트에이 링크를 클릭
그것은 에 저를 리디렉션해야을 :
http://www.photographers.co.uk/Nottingham-Portrait-Photographers
그러나 실제로 나에 리디렉션됩니다 :
http://www.photographers.co.uk/Nottinghamshire-Portrait-Nottingham-Photographers
어떤 도움을 주 시겠어요?
http : //www.photographers.co.uk/%1-%2-%3-Photographers?'에'= (. *) & specialty = (. *) & address4 = (. *) 1 '은 전문은'% 2'이고 주소 4는'% 3'입니다. 원하는 경우 해당 행을 'http : //www.photographers.co.uk/%3%2-Photographers?'로 간단히 변경할 수 있습니다. 이 주소와 같은 주소는 모두 해당 형식으로 변환됩니다. – craniumonempty