Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 28th, 2005, 12:42 AM
Sha Sha is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 6 Sha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 50 sec
Reputation Power: 0
Clarification of mod_rewrite's RewriteRule is needed.

Greetings.
Apache Guru help need.
I ask a clarification for the following.

I'm using the .htaccess in some dir
---==========
RewriteEngine On

RewriteRule ^AAA/(.+)$ BBB/$1 [NC]
RewriteRule ^BBB/(.+)$ CCC/$1 [NC]

RewriteRule ^CCC/(.+).html$ nph-page.php?ps=$1[NC]
---==========

Which accidently rewrites the /AAA/some.html into nph-page.php?ps=some.html/some.html/some

I expect to receive
page.php?ps=some.html
not triple of them

the mod_rewrite.log is
---==========
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add path-info postfix: t:/html/httpdocs/content/aaa -> t:/html/httpdocs/content/aaa/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/aaa/index.html -> aaa/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^AAA/(.+)$' to uri 'aaa/index.html'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (2) [per-dir t:/html/httpdocs/content/] rewrite aaa/index.html -> BBB/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add per-dir prefix: BBB/index.html -> t:/html/httpdocs/content/BBB/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add path-info postfix: t:/html/httpdocs/content/BBB/index.html -> t:/html/httpdocs/content/BBB/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/BBB/index.html/index.html -> BBB/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^BBB/(.+)$' to uri 'BBB/index.html/index.html'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (2) [per-dir t:/html/httpdocs/content/] rewrite BBB/index.html/index.html -> CCC/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add per-dir prefix: CCC/index.html/index.html -> t:/html/httpdocs/content/CCC/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add path-info postfix: t:/html/httpdocs/content/CCC/index.html/index.html -> t:/html/httpdocs/content/CCC/index.html/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/CCC/index.html/index.html/index.html -> CCC/index.html/index.html/index.html
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^CCC/(.+).html$' to uri 'CCC/index.html/index.html/index.html'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (2) [per-dir t:/html/httpdocs/content/] rewrite CCC/index.html/index.html/index.html -> nph-page.php?ps=index.html/index.html/index
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) split uri=nph--page.php?ps=index.html/index.html/index -> uri=nph-page.php, args=ps=index.html/index.html/index
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add per-dir prefix: nph-page.php -> t:/html/httpdocs/content/nph-page.php
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (2) [per-dir t:/html/httpdocs/content/] strip document_root prefix: t:/html/httpdocs/content/nph-page.php -> /content/nph-page.php
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (1) [per-dir t:/html/httpdocs/content/] internal redirect with /content/nph-page.php [INTERNAL REDIRECT]
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/nph-page.php -> nph-page.php
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^AAA/(.+)$' to uri 'nph-page.php'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/nph-page.php -> nph-page.php
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^BBB/(.+)$' to uri 'nph-page.php'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] strip per-dir prefix: t:/html/httpdocs/content/nph-page.php -> nph-page.php
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (3) [per-dir t:/html/httpdocs/content/] applying pattern '^CCC/(.+).html$' to uri 'nph-page.php'
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e5d38/initial/redir#1] (1) [per-dir t:/html/httpdocs/content/] pass through t:/html/httpdocs/content/nph-page.php
---======

the problem is
127.0.0.1 - - [27/Sep/2005:20:37:21 +0400] [www.domain.com/sid#868d40][rid#25e0398/initial] (3) [per-dir t:/html/httpdocs/content/] add path-info postfix: t:/html/httpdocs/content/BBB/index.html -> t:/html/httpdocs/content/BBB/index.html/index.html

When I add options [L] or [PT] to the rules in .htaccess the problem disappears.

Could anyone clarify me why without [L] or [PT] options Apache works a bit odd from my point of view.

Thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Clarification of mod_rewrite's RewriteRule is needed.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway