apache - Stuck on RewriteRule in htaccess -
i stuck in redirecting urls. think there can't oversee missing. when test redirect goes correct url, sticks old url behinde new url.
this got stuck:
rewritecond %{query_string} lang=uk&page=page rewriterule ^(.*)$ domain/page/ [l,r=301] rewritecond %{query_string} lang=fr&page=page rewriterule ^(.*)$ domain/page/ [l,r=301] rewritecond %{query_string} lang=uk&page=about rewriterule ^(.*)$ domain/about/ [l,r=301] rewritecond %{query_string} lang=uk&page=about rewriterule ^(.*)$ domain/about/ [l,r=301] rewritecond %{query_string} lang=uk&page=news rewriterule ^(.*)$ domain/info/ [l,r=301] rewritecond %{query_string} lang=fr&page=news rewriterule ^(.*)$ domain/info/ [l,r=301]
i scared stuck big htaccess file if redirects individual. slow things down?
lang=nl, uk, us, fr go same page. not page= got same pagename after change. in advance,
you can have specific redirects first page name not same target followed single rule query parameter page
has same value target uri. code can shortened these 2 rules only.
rewriteengine on rewritecond %{query_string} lang=(fr|uk|us|nl)&page=news rewriterule ^ /info/? [l,r=301] rewritecond %{query_string} lang=(fr|uk|us|nl)&page=([^&]+) rewriterule ^ /%2/? [l,r=301]
Comments
Post a Comment