S
S
SeiLove2015-12-02 15:51:45
htaccess
SeiLove, 2015-12-02 15:51:45

Correct 301 redirect with parameters?

Good afternoon. I'm trying to bring a link of this kind site.ru/news/&limit=11 to this site.ru/news/

RewriteEngine on
RewriteRule !^/?(sitemap|robots|yandex|favicon|modules|images|demos|js|core|files|interfaces|modules|css|img|resources|php)(.*) index.php
AddDefaultCharset utf-8
RewriteRule ^/news\?limit=(.+) /news/$1 [R=301,L]

But it doesn't work at all. Neither so
RewriteRule ^/news\?limit=(.+) /news/$1 [L,R=301]
nor so
RewriteCond %{QUERY_STRING} ^limit=11$
RewriteRule ^index.php$ http:// site.ru/news/ ? [L,R=301]

Does anyone know what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SeiLove, 2015-12-02
@SeiLove

RewriteCond %{QUERY_STRING} ^limit=([0-9]{2})$
RewriteRule $ /news/? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question