Страница 1 из 1

mod_rewrite

Добавлено: 2011-06-08 12:38:21
sfox
Упорно не жрет выражение.
http://tmp/lot/1 возвращает 404 ошибку. Подскажите, что не так сделал то?

Код: Выделить всё

        <Directory />
            allow from all
            Options +Indexes
            AllowOverride All
            DirectoryIndex index.php
            RewriteEngine On
            Options +FollowSymlinks
            RewriteBase /
            RewriteRule ^lot/(.*)$ /index.php?lid=$1
        </Directory>

Re: mod_rewrite

Добавлено: 2011-06-08 13:13:35
Le1
Покажи эррор лог.

Попробуй чет на подобии:

Код: Выделить всё

<Directory />
	allow from all
	Options +Indexes
	Options +FollowSymlinks
	AllowOverride All
	DirectoryIndex index.php
	RewriteEngine On
	RewriteBase /lot
	RewriteRule ^(.*)$ /index.php?lid=$1
</Directory>

Re: mod_rewrite

Добавлено: 2011-06-08 13:16:52
sfox

Код: Выделить всё

[Wed Jun 08 14:01:58 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
[Wed Jun 08 14:02:01 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
[Wed Jun 08 14:02:18 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
[Wed Jun 08 14:02:20 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
[Wed Jun 08 14:02:20 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
[Wed Jun 08 14:02:43 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot
RewriteBase /lot делать не хочется, не один симлинк будет.

Re: mod_rewrite

Добавлено: 2011-06-08 13:27:31
Le1
/usr/local/www/tmp/lot - вот этот путь правильный ?
Покажи кусок конфига с апача, где описын DocumentRoot

Re: mod_rewrite

Добавлено: 2011-06-08 13:29:13
sfox
конечно, нет. на то и mod_rewrite

Re: mod_rewrite

Добавлено: 2011-06-08 13:34:51
Le1
Можешь показать конфиг апача ?
Модуль mod_rewrite подгружен ?

Re: mod_rewrite

Добавлено: 2011-06-08 13:37:16
sfox
Le1 писал(а):Можешь показать конфиг апача ?
Модуль mod_rewrite подгружен ?
Весь? :-D
Подгружен)

Код: Выделить всё

RewriteCond   %{REQUEST_FILENAME}       !-d
RewriteCond   %{REQUEST_FILENAME}       !-f
RewriteRule   ^(.*) index.php?%{QUERY_STRING}
отрабатывает за милую душу

Re: mod_rewrite

Добавлено: 2011-06-08 13:47:55
Le1
Вот так у меня работает:
Оригинальный URL: http://tmp/lot/index.php?lid=1
Rewritten URL: http://tmp/lot/1.html

Код: Выделить всё

RewriteEngine On
RewriteRule ^lot/([^/]*)\.html$ /lot/index.php?lid=$1 [L]

Re: mod_rewrite

Добавлено: 2011-06-08 13:54:19
sfox
увы

Код: Выделить всё

[Wed Jun 08 14:51:34 2011] [error] [client 83.243.64.10] File does not exist: /usr/local/www/tmp/lot/1.html

Re: mod_rewrite

Добавлено: 2011-06-08 14:25:34
Le1
Х.З. тогда...
У тебя похоже сам модуль не работает, при рестарте апача не ругается ?
Попробуй перекомпилить модуль...