重定向不正确

时间:2013-03-07 14:17:48

标签: .htaccess url-redirection

我有网站http://paweljanicki.pl/Realizacje/

RewriteEngine On 
RewriteBase / 

RewriteCond %{HTTP_HOST} !^paweljanicki.pl$ [NC]
RewriteRule ^(.*)$ http://paweljanicki.pl/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://paweljanicki.pl/$1/ [L,R=301]

RewriteCond %{REQUEST_URI} ^\/Realizacje.aspx$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Realizacje/ [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Kontakt.aspx$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Kontakt/ [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Galeria.aspx$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Galeria/ [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Linki.aspx$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Linki/ [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Mapa-strony.aspx$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Mapa-strony/ [L,R=301]

RewriteCond %{REQUEST_URI} ^\/Galeria.aspx$
RewriteCond %{QUERY_STRING} ^gId=([0-9]*)$
RewriteRule ^(.*)$ /Galeria/%1/? [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Galeria.aspx$
RewriteCond %{QUERY_STRING} ^gId=([0-9]*)&sgId=([0-9]*)$
RewriteRule ^(.*)$ /Galeria/%1/%2/? [L,R=301]
RewriteCond %{REQUEST_URI} ^\/Galeria.aspx$
RewriteCond %{QUERY_STRING} ^gId=([0-9]*)&sgId=([0-9]*)&pId=([0-9]*)$
RewriteRule ^(.*)$ /Galeria/%1/%2/%3/? [L,R=301]

RewriteRule ^Galeria/$ Galeria.aspx [L]
RewriteRule ^Galeria/([^/]+)/?$ Galeria.aspx?gId=$1 [L]
RewriteRule ^Galeria/([^/]+)/([^/]+)/?$ Galeria.aspx?gId=$1&sgId=$2 [L]
RewriteRule ^Galeria/([^/]+)/([^/]+)/([^/]+)/?$ Galeria.aspx?gId=$1&sgId=$2&pId=$3 [L]

RewriteCond %{REQUEST_URI} ^\/Realizacje.aspx$
RewriteCond %{QUERY_STRING} ^gId=([0-9]*)$
RewriteRule ^(.*)$ /Realizacje/%1/? [L,R=301]

RewriteRule ^Realizacje/$ Realizacje.aspx [L]
RewriteRule ^Realizacje/([^/]+)/?$ Realizacje.aspx?pId=$1 [L]

RewriteRule ^Kontakt/$ Kontakt.aspx [L]
RewriteRule ^Linki/$ Linki.aspx [L]
RewriteRule ^Mapa-strony/$ Mapa-strony.aspx [L]

RewriteCond %{REQUEST_URI} ^\/Programy-na-Zlecenie/$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ /Pisanie-Programow-na-Zamowienie/ [L,R=301]

#to use relative paths in RewriteMap, map files must reside in the same folder as .htaccess
#http://www.helicontech.com/ape/doc/mod_rewrite.htm
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteMap revmapfile txt_rev:mapfile.txt [NC]
#RewriteCond %{QUERY_STRING} (.+) 
#RewriteRule ^Default\.aspx$ ${mapfile:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ Default.aspx?${revmapfile:$1} [NC,L,NS]

0 个答案:

没有答案