Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: apache rewrite rule


  • Subject: Re: lug-bg: apache rewrite rule
  • From: Sava Chankov <sava@xxxxxxxxxxxxx>
  • Date: Wed, 09 Feb 2005 15:30:15 +0200

Peter Pentchev wrote:
On Wed, Feb 09, 2005 at 02:15:49PM +0200, ianchov@xxxxxxx wrote:
я, че така ще стане и с Rewrite:
 RewriteEngine on
 RewriteRule http://www.namebg.com/(.*) http://www.name.com/$1 [L,PT]
 RewriteRule http://www.namebg.biz/(.*) http://www.name.com/$1 [L,PT]
10x
ps. vagnoto e v address bara obache da se poiaviama samo name.com nezavisimo
dali se iska namebg.biz ili ne6to drugo. mislia che mai tova pravi
rewrite.popravete me ako gresha

Да, Rewrite изпраща на клиента HTTP redirect (обикновено 302, но можеш
да го конфигурираш - redirect={permanent,temp,seeother}), така че
клиентският браузър претакова URL-то и в address bar-а си, и изпраща
нова заявка.

[L, PT] няма да върнат на клиента HTTP redirect, а обработката ще продължи през останалите филтри, alias-и, ScriptAlias-и и т.н.
За да пренасочва, правилото трябва да e с флаг [R]

redirect|R  [=code]' (force redirect)
Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given a HTTP response of 302 (MOVED TEMPORARILY) is used. If you want to use other response codes in the range 300-400 just specify them as a number or use one of the following symbolic names: temp (default), permanent, seeother. Use it for rules which should canonicalize the URL and give it back to the client, e.g., translate ``/~'' into ``/u/'' or always append a slash to /u/user, etc.

Note: When you use this flag, make sure that the substitution field is a valid URL! If not, you are redirecting to an invalid location! And remember that this flag itself only prefixes the URL with http://thishost[:thisport]/, rewriting continues. Usually you also want to stop and do the redirection immediately. To stop the rewriting you also have to provide the 'L' flag.



--
Sava Chankov                                     Сава Чанков
research and development                  проучване и развой
http://www.blueboard.biz                         блуборд оод
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.