vitaMAX 3 Posted December 25, 2014 Report Share Posted December 25, 2014 Делаю редирект в .htaccess по типу: Redirect 301 /20-page1.html http://сайт.рф/page1.html - работет всё отлично. Но тут у меня выскочила страница вида http://сайт.рф/production.html?id=10 Пытаюсь ее перенаправить, но не выходит Redirect 301 /production.html?id=10 http://заводтары.рф/catalog/b-u-poddony-pallety.html - перенаправление не срабатывает. Печему? Quote Link to post Share on other sites
Transformer 442 Posted December 25, 2014 Report Share Posted December 25, 2014 <IfModule mod_rewrite.c> RewriteCond %{HTTP_HOST} ^www.moisait.com/$ [NC] RewriteRule ^(.*)$ http://moisait.com/$1 [R=301,L] </IfModule> вот пример редиректа с www на без www меняйте URL на свой и будет работать RewriteCond что перенаправлять RewriteRule куда перенаправлять Quote Link to post Share on other sites
vitaMAX 3 Posted December 25, 2014 Author Report Share Posted December 25, 2014 Спасибо за совет, но это немного не то. У меня настроен редирект с www на без www. Мне нужен редирект конкретной страницы, а не страниц с шаблоном/правилом url. Quote Link to post Share on other sites
Transformer 442 Posted December 25, 2014 Report Share Posted December 25, 2014 Спасибо за совет, но это немного не то. У меня настроен редирект с www на без www. Мне нужен редирект конкретной страницы, а не страниц с шаблоном/правилом url. RewriteCond что перенаправлять RewriteRule куда перенаправлять задавайте любые url Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 не выходит. http://заводтары.рф/production.html?id=10 нужно переадресовать на http://заводтары.рф/catalog/b-u-poddony-pallety.html Помогите, если не затруднит Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 Redirect 301 /production.html?id=10 http://заводтары.рф/catalog/b-u-poddony-pallety.html не срабатывает Quote Link to post Share on other sites
vitponom 57 Posted December 26, 2014 Report Share Posted December 26, 2014 htaccess не понимает .рф домены: сделай так: Redirect 301 /production.html?id=10 http://xn--80aafim8bqo7f.xn--p1ai/catalog/b-u-poddony-pallety.html k-park 1 Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 хм. у меня все варианты в кириллице - норм работает. Redirect 301 /production.html?id=10 http://xn--80aafim8bqo7f.xn--p1ai/catalog/b-u-poddony-pallety.html также не срабатывает. Quote Link to post Share on other sites
vitponom 57 Posted December 26, 2014 Report Share Posted December 26, 2014 Значит поставь строчку перед этими: RewriteCond %{HTTP_HOST} ^www.moisait.com/$ [NC] RewriteRule ^(.*)$ http://moisait.com/$1 [R=301,L] Но после этих: RewriteEngine onRewriteBase / Quote Link to post Share on other sites
vitponom 57 Posted December 26, 2014 Report Share Posted December 26, 2014 В итоге получится так: RewriteEngine onRewriteBase / Redirect 301 /production.html?id=10 http://xn--80aafim8bqo7f.xn--p1ai/catalog/b-u-poddony-pallety.html RewriteCond %{HTTP_HOST} ^www.moisait.com/$ [NC] RewriteRule ^(.*)$ http://moisait.com/$1 [R=301,L] Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 попробовал и так - не перекидывает. RewriteEngine On RewriteBase / Redirect 301 /production.html?id=10 http://xn--80aafim8bqo7f.xn--p1ai/catalog/b-u-poddony-pallety.html RewriteCond %{HTTP_HOST} ^www\.xn--80aafim8bqo7f\.xn--p1ai$ [NC] RewriteRule ^(.*)$ http://xn--80aafim8bqo7f.xn--p1ai/$1 [R=301,L] здесь в чем-то другом проблема.. не мойму в чем. Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 думаю всё дело в знаке вопроса - он как-то влияет Quote Link to post Share on other sites
vitaMAX 3 Posted December 26, 2014 Author Report Share Posted December 26, 2014 Redirect 301 /production.html http://xn--80aafim8bqo7f.xn--p1ai/catalog/b-u-poddony-pallety.html - срабатывает же без ?id=10 Quote Link to post Share on other sites
mike 25 Posted December 26, 2014 Report Share Posted December 26, 2014 Добавьте условие с переменной QUERY_STRING. Quote Link to post Share on other sites
Crack_key 48 Posted February 10, 2015 Report Share Posted February 10, 2015 Redirect 301 /production.html?id=10 http://заводтары.рф/catalog/b-u-poddony-pallety.html не срабатывает Может так? Redirect 301 /production\.html\?id=10 http://заводтары.рф/catalog/b-u-poddony-pallety.html Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.