IMHO.WS

IMHO.WS (http://www.imho.ws/index.php)
-   Веб-программирование (http://www.imho.ws/forumdisplay.php?f=29)
-   -   htaccess help (http://www.imho.ws/showthread.php?t=82805)

Ukrainer 30.03.2005 11:11

htaccess help
 
как зделать чтобы
domain.com/papka/first-class.html

передавалось нa fail.php

если делать без папки то все пучком

а вот папка нужна

RewriteRule papka\/(.+).html fail.php?q=$1

эта запись как то не подходит . передает на search

papka/first-class.html к примеру

DeADMoroZ 30.03.2005 12:45

RewriteRule ^\/papka\/(.+)\.html /fail.php$q=$1

Ghost 30.03.2005 14:02

Что значит "передает на search"? У тебя есть еще RewriteRule? Может стоит расположить данное в самом начале и в его конце указать директиву [L], указывающую на то, что не надо применять последующие rewrite-правила, если это выполнено успешно:
Код:

RewriteRule ^\/papka\/(.+)\.html$ /fail.php?q=$1 [L]
Из мана к апачу:
Цитата:

'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewriting rules. This corresponds to the Perl last command or the break command from the C language. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'.

Ukrainer 31.03.2005 02:48

спасиб проблема решилас


Часовой пояс GMT +4, время: 00:44.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.