What is a "Foreword" to a blog?
RewriteRule: Parenthesis not capturing
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Apache HTTP Server > RewriteRule: Parenthesis not capturing 13 May 2007 13:26:42

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

RewriteRule: Parenthesis not capturing

Garth Winter Webb 13 May 2007 13:26:42
 Hello, I'm trying to use the RewriteRule directive to rewrite a simple
request. I've added these lines to a VirtualHost section of an apache
running on 'my.host' listening on port 80:

RewriteEngine on

RewriteLog "/tmp/rewrite.log"
RewriteLogLevel 9
RewriteRule ^/(.+) http://my.host:8600­/somepath/$1 [P]

When I make a request like this:

http://my.host/foo

I see these 5 lines in my rewrite log:


192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]
[my.host/sid#80d18a4][rid#80e0794/initial] (2) init rewrite engine with
requested uri /foo
192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]
[my.host/sid#80d18a4][rid#80e0794/initial] (3) applying pattern '^/(.*)'
to uri '/foo'
192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]
[my.host/sid#80d18a4][rid#80e0794/initial] (2) rewrite /foo ->
http://my.host:8600­/somepath/
192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]
[my.host/sid#80d18a4][rid#80e0794/initial] (2) forcing proxy-throughput
with http://my.host:8600­/somepath/
192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]
[my.host/sid#80d18a4][rid#80e0794/initial] (1) go-ahead with proxy
request proxy:http://my.hos­t:8600/somepath/ [OK]


For some reason the parenthesis are not capturing and $1 contains an
empty string. The parenthesis HAD to match because otherwise the rule
("A '/' followed by at least one character") would have failed and I
would not have gotten these log messages. What am I missing here?

Thanks,

--
Garth Winter Webb <garth@perijove.com­>

-------------------­--------------------­--------------------­----------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.a­pache.org/userslist.­html> for more info.
To unsubscribe, e-mail: users-unsubscribe@h­ttpd.apache.org
" from the digest: users-digest-unsubs­cribe@httpd.apache.o­rg
For additional commands, e-mail: users-help@httpd.ap­ache.org


Add comment
Garth Winter Webb 16 February 2003 22:28:49 permanent link ]
 On Sun, 2003-02-16 at 11:22, Garth Winter Webb wrote:
192.168.1.124 - - [16/Feb/2003:12:14:09 -0800]> [my.host/sid#80d18a4][rid#80e0794/initial] (3) applying pattern '^/(.*)'> to uri '/foo'

I'm sorry, this line was from a previous attempt when the RewriteRule
was '^/(.*)'. This should be '^/(.+)'

--
Garth Winter Webb <garth@perijove.com­>

-------------------­--------------------­--------------------­----------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.a­pache.org/userslist.­html> for more info.
To unsubscribe, e-mail: users-unsubscribe@h­ttpd.apache.org
" from the digest: users-digest-unsubs­cribe@httpd.apache.o­rg
For additional commands, e-mail: users-help@httpd.ap­ache.org


Add comment
Guest 13 May 2007 13:26:09 permanent link ]
 :-D­ noob
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Apache HTTP Server > RewriteRule: Parenthesis not capturing 13 May 2007 13:26:42

see also:
[Mail Services] - Re: Mail lists
[Nukes Development] - question DataBase
jboss-head build.169 Build Successful
пройди тесты:
see also:
MY SISTER-MY WORLD
The story behind stupid…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .