Jump to content

Редирект и файл .htaccess в корневом каталоге


Recommended Posts

Всем привет!

Помогите разобраться в ситуации: необходимо сделать редирект с адреса mysite.ru на www.mysite.ru.

Я действую "по классике" - добавляю в корневой файл .htaccess после строки RewriteEngine On
две строчки
RewriteCond %{HTTP_HOST} ^mysite.ru
RewriteRule (.*) http://www.mysite.ru/$1 [R=301,L]

В итоге - всё перестаёт работать. Браузер выдаёт "500 Internal Server Error":
====================
Internal Server Error
The 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 из исходного пакета.

В чём здесь дело, кто знает?

Link to post
Share on other sites
  • 4 weeks later...

Сделал переадресацию со старых урлов на новые:

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]

тогда редирект проходит нормально, но не работают все статические страницы в меню...

Пожалуйста, подскажите!

Link to post
Share on other sites
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...