Simple question

Topics: Developer Forum
Sep 3, 2008 at 4:21 AM
Edited Sep 3, 2008 at 9:19 AM
RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.dinoch\.net
RewriteRule ^/(.*)$ /%1/$1 [L] 

I donnt understand the "%1" means... (Yes I know now)

another question
 RewriteRule ^(.*)$ /%{HTTP_HOST}/$1
 RewriteRule ^/([a-z0-9\-]+)\.test\.com:8001/(.*)$ /images/$1/$2 [L,R]

when i type the http://aaaaaa.test.com:8001/blog in the ie address bar
 it cannt redirect to the http://aaaaaa.test.com:8001/images/aaaaaa/blog why??
give me 404 error

Coordinator
Sep 3, 2008 at 7:30 PM
Did you look at your logfile? 
It sure looks like you have an infinite loop in your Rules.  The first rule says, for every URL, prepend the value of the HTTP_HOST server variable to it.

When you pass in http://aaa.test.com/blog, the first time through, your URL changes from /blog to /aaa.test.com/blog. 
The second time through, it changes from /aaa.test.com/blog to /aaa.test.com/aaa.test.com/blog .
And so on. 
It loops forever, until it reaches the iteration limit which is builtin to IIRF.

Your second rule is never evaluated.

I think you need to re-examine your rules.