Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More!
  #1  
Old November 22nd, 2000, 05:11 PM
wimpzilla wimpzilla is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 wimpzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wimpzilla
Problem:
Trying to setup mass virtual hosting via mod_rewrite example: http://www.engelschall.com/pw/apache/rewriteguide. Looking to set virtual host document root based on incoming URI. The lookup in in the text vhost map fails because the key being passed to it is "%1" and not the value from the previous RewriteCond.

rewrite.log:
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (2) init rewrite engine with requested uri /Sites/default.html
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (3) applying pattern '^/(.*)$' to uri '/Sites/default.html'
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (4) RewriteCond: input='' pattern='!^/commonurl1/.*' => matched
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (4) RewriteCond: input='' pattern='!^/commonurl2/.*' => matched
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (4) RewriteCond: input='testqa16:82' pattern='!^$' => matched
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (5) map lookup OK: map=lowercase key=%{HTTP_HOST -> val=%{http_host
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (4) RewriteCond: input='%{http_host|NONE}' pattern='^(.+)$' => matched
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (6) cache lookup FAILED, forcing new map lookup
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (5) map lookup FAILED: map=vhost[txt] key=%1
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (4) RewriteCond: input='' pattern='^(/.*)$' => not-matched
10.207.13.51 - - [22/Nov/2000:14:29:09 -0800] [realwww.foo.com/sid#a1af8][rid#b7a80/initial] (1) pass through /Sites/default.html

Question:
Why does map=lowercase key=%{HTTP_HOST AND map=vhost[txt] key=%1 NOT have the replaced values for these lookups?

Reply With Quote
  #2  
Old November 22nd, 2000, 06:22 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>map lookup OK: map=lowercase key=%{HTTP_HOST-> val=%{http_host

Converting HTTP_HOST to http_host doesn't do what you want. To convert to lowercase, I would do:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap lc int:tolower
</IfModule>

Example:

RewriteRule ^([A-Za-z0-9_]+)([^/A-Za-z0-9_]+)/?$ $1/$2/
RewriteRule ^([^/]+)/?(.*)/$ index.php?category=${lc:$1}&id=$2 [T=application/x-httpd-php,L]

$1, the category, will convert to lowercase while $2, the id, remains as is.

Reply With Quote
  #3  
Old November 22nd, 2000, 08:45 PM
wimpzilla wimpzilla is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 wimpzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wimpzilla
The IfModule idiom is useful, thanks. I found one error in my httpd.conf:
RewriteCond %{REQUEST_URL} ...

should be

RewriteCond %{REQUEST_URI}

The docs have REQUEST_URL with the letter "L" where the variable is "REQUEST_URI" with an "I".

The key=%1 is still incorrect. When I run the same config params on another platform the key="testqa16:82" value is correct?!

Reply With Quote
  #4  
Old December 5th, 2000, 11:38 AM
wimpzilla wimpzilla is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 wimpzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wimpzilla
The problem seems to be isolated to 1.3.14. When I compile apache 1.3.9 + mod_rewrite the key is correctly passed to the script/program/text file.

The problem exists under Solaris 2.6 and 2.8.

I will check if apache 1.3.14 under linux exhibits the same problem.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > mod_rewite problems unders Solaris 8


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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