www.platon.net
When you need to redirect several different URLs distinguished by their query string to a single address, or you need special rules, here are some tips you can use, with an explanation of each one.
<?php
#URL, that match is http(s)://domain.ext/?kontakt(y) - redirect to http(s)://domain.ext/kontakt/
RewriteCond %{QUERY_STRING} ^kontakt$ [OR]
RewriteCond %{QUERY_STRING} ^kontakty$
RewriteRule ^ /kontakt/ [L,R=301]
#Redirecting from http(s)://domain.ext/?sidlo to http(s)://domain.ext/kontakt/#sidlo
RewriteCond %{QUERY_STRING} ^sidlo$
RewriteRule ^ /kontakt/#sidlo [NE,L,R=301]
#Redirecting from http(s)://domain.ext/kontakt/bratislava?pobocka to
#http(s)://domain.ext/kontakt/#bratislava using a 302 redirect (temporary)
RewriteCond %{QUERY_STRING} ^pobocka$
RewriteRule ^kontakt/bratislava /kontakt/#bratislava [L,R=302]
#Redirecting from http(s)://domain.ext/kontakt/sidlo to http(s)://domain.ext/kontakt/
RewriteRule ^kontakt/sidlo /kontakt/ [L,R=301]
#Redirecting everything that begins with http(s)://domain.ext/cz/kontakt/ to
#http(s)://domain.ext/kontakt/cz/ - whatever follows the last slash is appended
RewriteCond %{QUERY_STRING} ^extra$
RewriteRule ^cz/kontakt/(.*)$ /kontakt/cz/$1 [NE,L,R=301]
?>
We accept problem reports and any other feedback related to the use of our products and services.
helpdesk@platon.net +421 222 111 321
In case you need any help, contact us by e-mail or by phone.
Give our online help center a try. You will find more than:
Questions about our products or any specific request? Contact us.