Shake
2012-05-22 11:49:25 UTC
Hi all,
I have a XAMPP installed on my own machine. using an Apache2 over
windows 7 64bits.
And I am fighting with the RewriteMap. By now, it is winning the battle.
I have this:
[...] are to avoid long unnecesary paths here. Are right on the files
On the virtualhost configuration:
--------------------------
[...]
RewriteEngine on
RewriteLog "[...]logs/rewrite.log"
RewriteLogLevel 9
RewriteMap blogmaps "txt:[...]/blogmaps.txt"
[...]
--------------------------
The [...]/blogmaps.txt file:
--------------------------
##
## Blog mapping.
##
www.domain1.dev domain1
www.domain1.com domain1
www.domain2.dev domain2
www.domain2.com domain2
--------------------------
(.dev is a local for development "tld" we use)
And finally, the .htaccess
--------------------------
[...]
Rewriterule ^blog/$ ${blogmaps:%{SERVER_NAME}|NONE}/blog/index.php
[NC,L,QSA]
[...]
--------------------------
Always returns NONE. I do some test, Like:
--------------------------
RewriteCond %{SERVER_NAME} ^(.+)
RewriteCond %1 ^(.+)
RewriteCond ${blogmaps:%1} (.+)
Rewriterule ^blog/$ %1/blog/index.php
--------------------------
And I get this form the Rewrite Log:
--------------------------
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='' pattern='(.+)' => not-matched
--------------------------
Trying just:
--------------------------
RewriteCond %{SERVER_NAME} ^(.+)
RewriteCond ${blogmaps:%1} (.+)
Rewriterule ^blog/$ %1/blog/index.php
--------------------------
I get
--------------------------
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='' pattern='(.+)' => not-matched
--------------------------
And a lot of test, and tries have always the same result, included doing
(hardcoding the domain):
RewriteCond ${blogmaps:www.domain1.dev} (.+)
Rewriterule ^blog/$ %1/blog/index.php
And the result is always input='' when using the RewriteMap
${blogmaps:something}
I spent a lot of time checking syntaxis and these kind of mistakes,
After this, searching for answers on the web. Trying to discover is I
was doing a common mistake or something... And after this, I started to
see if perhaps the trouble is with using windows....
But I found no answers. So finally , and a little desesperated :) I ask
for help. Or a clue... to solve this "mistery" :)
thanks to all.
Rgds.
I have a XAMPP installed on my own machine. using an Apache2 over
windows 7 64bits.
And I am fighting with the RewriteMap. By now, it is winning the battle.
I have this:
[...] are to avoid long unnecesary paths here. Are right on the files
On the virtualhost configuration:
--------------------------
[...]
RewriteEngine on
RewriteLog "[...]logs/rewrite.log"
RewriteLogLevel 9
RewriteMap blogmaps "txt:[...]/blogmaps.txt"
[...]
--------------------------
The [...]/blogmaps.txt file:
--------------------------
##
## Blog mapping.
##
www.domain1.dev domain1
www.domain1.com domain1
www.domain2.dev domain2
www.domain2.com domain2
--------------------------
(.dev is a local for development "tld" we use)
And finally, the .htaccess
--------------------------
[...]
Rewriterule ^blog/$ ${blogmaps:%{SERVER_NAME}|NONE}/blog/index.php
[NC,L,QSA]
[...]
--------------------------
Always returns NONE. I do some test, Like:
--------------------------
RewriteCond %{SERVER_NAME} ^(.+)
RewriteCond %1 ^(.+)
RewriteCond ${blogmaps:%1} (.+)
Rewriterule ^blog/$ %1/blog/index.php
--------------------------
And I get this form the Rewrite Log:
--------------------------
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='' pattern='(.+)' => not-matched
--------------------------
Trying just:
--------------------------
RewriteCond %{SERVER_NAME} ^(.+)
RewriteCond ${blogmaps:%1} (.+)
Rewriterule ^blog/$ %1/blog/index.php
--------------------------
I get
--------------------------
RewriteCond: input='www.domain1.dev' pattern='^(.+)' => matched
RewriteCond: input='' pattern='(.+)' => not-matched
--------------------------
And a lot of test, and tries have always the same result, included doing
(hardcoding the domain):
RewriteCond ${blogmaps:www.domain1.dev} (.+)
Rewriterule ^blog/$ %1/blog/index.php
And the result is always input='' when using the RewriteMap
${blogmaps:something}
I spent a lot of time checking syntaxis and these kind of mistakes,
After this, searching for answers on the web. Trying to discover is I
was doing a common mistake or something... And after this, I started to
see if perhaps the trouble is with using windows....
But I found no answers. So finally , and a little desesperated :) I ask
for help. Or a clue... to solve this "mistery" :)
thanks to all.
Rgds.