httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Galić <i.ga...@brainsware.org>
Subject Re: questions about rewrite module
Date Mon, 26 Dec 2011 11:58:58 GMT


----- Original Message -----
> hi,

Hi,

Questions about how to *use* mod_rewrite -- or any module -- are
best asked on users@
 
> I encountered a problem while configured virtual host. My experiment
> environment is Apache2+fastcgi+php-cgi.
> 
> 
> I want to implement mass virtual hosting using rewrite rules based on
> apache rewrite module. That is, for a request url like:
> http://1000.xyz.com/test.php , apache will translate it to a
> absolute file path like: $DOCUMENT_ROOT/1000/test.php, and then get
> this script to execute.

Have you considered using something like mod_vhost_alias?

  http://httpd.apache.org/docs/current/mod/mod_vhost_alias.html
  http://wiki.apache.org/httpd/VirtualHostAlias
 
> And my conf is:
> 
> RewriteEngine On
> RewriteCond "%{HTTP_HOST}" "!^ www.xyz.com "
> RewriteCond "%{HTTP_HOST}" "^([^.]+)\.xyz\.com" [NC]
> RewriteRule "(.*)" "/%1$1" [PT]
> 
> I use inner redirection in order not to expose this detail to users.
> Besides, I succeeded when I use external redirection, namely the [R]
> tag instead of [PT] tag.
> When I use [PT] tag, apache cannot run expectedly. I request a url :
> http://1000.xyz.com/test.php , error message pops out like: The
> requested URL /1000/cgi-bin/php.fcgi/1000/test.php was not found on
> this server.
> 
> 
> I don't know if this error results from fastcgi, is it the
> inappropriate config in fastcgi or inevitable problem by using it?
> 
> 
> Really appreciate your help.
> 
> 
> Vic
> 
> --
> Best regards,
> 
> Rui Hu
> ----------------------------------------------------------------------------------------
> State Key Laboratory of Networking & Switching Technology
> Beijing University of Posts and Telecommunications(BUPT)
> MSN: tchrbupt@gmail.com
> -----------------------------------------------------------------------------------------
> 
> 
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Mime
View raw message