calvin Posted May 11, 2012 Report Share Posted May 11, 2012 Всем привет!Помогите разобраться в ситуации: необходимо сделать редирект с адреса mysite.ru на www.mysite.ru.Я действую "по классике" - добавляю в корневой файл .htaccess после строки RewriteEngine Onдве строчкиRewriteCond %{HTTP_HOST} ^mysite.ruRewriteRule (.*) http://www.mysite.ru/$1 [R=301,L]В итоге - всё перестаёт работать. Браузер выдаёт "500 Internal Server Error":====================Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, webmaster@mysite.ru and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.====================Мало того, попытка исправить .htaccess, сделав как было, не помогает - удаляю эти две строчку, а ошибка остаётся!!! Мистика какая-то!!! Ж8-()Спасло только копирование на сервер файла .htaccess из исходного пакета.В чём здесь дело, кто знает? Quote Link to post Share on other sites
Kosjak76 Posted May 11, 2012 Report Share Posted May 11, 2012 Чем редактировали? В какой кодировке сохраняли? Quote Link to post Share on other sites
calvin Posted May 11, 2012 Author Report Share Posted May 11, 2012 Редактировал в Notepad.Сохранял просто - команда "Сохранить", никакую специальную кодировку не выбирал. Quote Link to post Share on other sites
Kosjak76 Posted May 11, 2012 Report Share Posted May 11, 2012 Попробуйте прямо через Тотал командер вставить Quote Link to post Share on other sites
calvin Posted May 11, 2012 Author Report Share Posted May 11, 2012 Тотал командера у меня нет. В какой кодировке файл должен быть сохранён? Quote Link to post Share on other sites
filth Posted May 11, 2012 Report Share Posted May 11, 2012 UTF-8, редактируй с помощью notepad++ Quote Link to post Share on other sites
calvin Posted May 11, 2012 Author Report Share Posted May 11, 2012 Спасибо, попробую.А сами-то мои строчки редиректа верные? Не будут они с чем-нибудь в Симле конфликтовать? Quote Link to post Share on other sites
calvin Posted May 11, 2012 Author Report Share Posted May 11, 2012 Да, видимо дело было в кодировке.Ноутпэд++ помог....Спасибо всем!*-) Quote Link to post Share on other sites
undermi Posted June 5, 2012 Report Share Posted June 5, 2012 Сделал переадресацию со старых урлов на новые: Redirect 301 /product_27.html http://www.explaymarket.ru/products/explay-gn-510Но при переадресации юзеру выдается такой урл:http://www.explaymarket.ru/products/explay-gn-510?module=PageView&page_url=product_27.htmlсамо собой страница не существуетКак с этим бороться? Если в .htaccess удалитьRewriteRule ^([^/]*)/?$ index.php?module=PageView&page_url=$1 [L,QSA]тогда редирект проходит нормально, но не работают все статические страницы в меню... Пожалуйста, подскажите! Quote Link to post Share on other sites
nigga Posted August 26, 2012 Report Share Posted August 26, 2012 поддерживаю крайний вопрос! Quote Link to post Share on other sites
Kosjak76 Posted August 26, 2012 Report Share Posted August 26, 2012 Проблема может быть в МЕСТЕ, где стоит правило... Такое правило надо ставить в конце файла, но перед Страницами и Главной 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.