Forumlar / National / Russian / Настройка .htaccess на 404 ошибку

Oughtem
#28800 2011-03-05 11:24

хочу настроить .htaccess так, чтобы не было сообщения "неверный урл", а был простой редирект на страницу /page.php?al=404.

Получилось наполовину. Когда пишу http://сайт/dfgdsgsdg, то всё нормально, редиректит.

Если сознательно исправить существующий урл, дописав, ему левые буквы, (например http://studportal.net.ua/page.php?al=internet-konkurs_shporaddddddd), то выдаётся редирект через 950-е сообщение (/message.php?msg=950). Как это исправить?

Вот код

ErrorDocument 400 http://studportal.net.ua/message.php?msg=930
ErrorDocument 401 http://studportal.net.ua/message.php?msg=930
ErrorDocument 403 http://studportal.net.ua/page.php?al=404
ErrorDocument 404 http://studportal.net.ua/page.php?al=404
ErrorDocument 500 http://studportal.net.ua/page.php?al=404

Добавляя строчку ErrorDocument 950 http://studportal.net.ua/page.php?al=404, обрекаешь сервер на такую ошибку:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@studportal.net.ua 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 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Bu gönderi Oughtem tarafından düzenlendi (2011-03-05 11:34, 14 yıllar önce)