LINUX.ORG.RU
ФорумAdmin

Помогите настроить mod_rewrite, plz


0

0

В общем, пытаюсь его настроить:
httpd.conf:

<VirtualHost review>
    ServerAdmin root@review
    DocumentRoot "/home/review/public_html"
     <Directory "/home/review/public_html">
      Options FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
     </Directory>
    ScriptAlias /cgi/ "/home/review/public_html/cgi/"
     <Directory "/home/review/public_html/cgi">
      AllowOverride All
      Options ExecCGI
      Order allow,deny
      Allow from all
     </Directory>
    ServerName review
    ErrorLog   "/home/review/error.log"
    RewriteLogLevel 9
    RewriteLog "/home/review/rewrite.log"
</VirtualHost>


.htaccess:

RewriteEngine  on
RewriteRule    ^([^/]+)/([^/]+)  /cgi/main.pl?mode=$1&type=$2
RewriteRule    ^([^/]+)          /cgi/main.pl?mode=$1
RewriteRule    ^                 /cgi/main.pl


log:
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ ->
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^([^/]+)/([^/]+)' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ ->
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^([^/]+)' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ ->
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (2) [per-dir /home/review/public_html/] rewrite  -> /cgi/main.pl
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (1) [per-dir /home/review/public_html/] internal redirect with /cgi/main.pl [INTERNAL REDIRECT]
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ -> 
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^([^/]+)/([^/]+)' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ -> 
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^([^/]+)' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] add path-info postfix: /home/review/public_html -> /home/review/public_html/
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] strip per-dir prefix: /home/review/public_html/ -> 
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (3) [per-dir /home/review/public_html/] applying pattern '^' to uri ''
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (2) [per-dir /home/review/public_html/] rewrite  -> /cgi/main.pl
127.0.0.1 - - [11/Jul/2001:01:46:43 +0400] [review/sid#7befe0][rid#973678/initial] (1) [per-dir /home/review/public_html/] internal redirect with /cgi/main.pl [INTERNAL REDIRECT]

Apache 1.3.20, Linux 2.4.6/WinNT4 SP5... chmod выставлен нормально, сам mod_rewrite, ессно, раскомментирован...

Ошибок нет, но при обращении к серверу браузеру ничего не выдается, вообще ничего, но при этом съедается вся свободная память (а ее немало и там и там), засирается своп, лог увеличивается сразу на 500-800 кб.

Похоже, что редирект зацикливается... Может я в регулярных выражениях напутал? Вообще надо путь от корня сервера разбить и передать в качестве параметров скрипту.

Подскажите где грабли? Не хотелось бы думать, что в ДНК... Или киньте, плиз, рабочий конфиг, я бы сам разобрался...

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.