Код: Выделить всё
## ---------------------------------------------
## Описание: Файл настроек движка на ModRewrite
## Автор : zg, 2008 год
## ---------------------------------------------
ErrorDocument 404 /error404.php
RewriteEngine On
Options +FollowSymlinks
## Текущее расположение данного файла относительно корня сайта
RewriteBase /
## Совместимость со старыми разделами
## Для работы требуется mod_alias
# ---------------------------------------------
# Статьи
RedirectMatch permanent ^/articles/vm-server/?(.*)$ /articles/os/vm/vm-server/$1
RedirectMatch permanent ^/articles/ImageCounter/?(.*)$ /articles/php/image-counter/$1
RedirectMatch permanent ^/articles/ImageList/?(.*)$ /articles/js/image-list/$1
RedirectMatch permanent ^/articles/locales/?(.*)$ /articles/php/locales/$1
RedirectMatch permanent ^/articles/mysql-charsets/?(.*)$ /articles/mysql/mysql-charsets/$1
RedirectMatch permanent ^/articles/php-common/?(.*)$ /articles/php/php-common/$1
RedirectMatch permanent ^/articles/php-net-mask/?(.*)$ /articles/php/php-net-mask/$1
RedirectMatch permanent ^/articles/php-sendmail/?(.*)$ /articles/php-sendmail-with-files/$1
RedirectMatch permanent ^/articles/sql-parser/?(.*)$ /articles/php/sql-parser/$1
RedirectMatch permanent ^/articles/xslt-first-step/?(.*)$ /articles/xml/xslt-first-step/$1
# ---------------------------------------------
## Запросы, которые идут к разделам и файлам php, направляем на индекс
RewriteCond %{REQUEST_URI} \.php$ [OR]
RewriteCond %{REQUEST_URI} /$ [OR]
RewriteCond %{REQUEST_URI} /[^\.]+$
RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
1. если был запрос на старый раздел, то отфутболить его по новому адресу
2. все остальные запросы к разделам и файлам пхп отправлять на точку входа в движок
Проблема собственно в том, что на моем домашнем сервере пашет на ура, а на хостинге делает ненужную обработку.
Домашний пример
Код: Выделить всё
zg# telnet 192.168.1.4 80
Trying 192.168.1.4...
Connected to 192.168.1.4.
Escape character is '^]'.
GET /articles/vm-server/ HTTP/1.1
Host: anton-pribora
HTTP/1.1 301 Moved Permanently
Date: Fri, 03 Apr 2009 05:28:16 GMT
Server: Apache/1.3.27 (Win32) PHP/5.2.8
Location: http://anton-pribora/articles/os/vm/vm-server/
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
Код: Выделить всё
%telnet anton-pribora.ru 80
Trying 195.208.0.16...
Connected to anton-pribora.ru.
Escape character is '^]'.
GET /articles/vm-server HTTP/1.1
Host: anton-pribora.ru
HTTP/1.1 301 Moved Permanently
Date: Fri, 03 Apr 2009 05:24:19 GMT
Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a PHP/5.2.8
Location: http://anton-pribora.ru/articles/os/vm/vm-server/?q=articles/vm-server
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
Вопрос в том как заставить апач делать редирект сразу, без последующей обработки реврайтом? (Как в первом варианте на локальном сервере)