Rewritemap and mod php not work

Hi all,

I need set the rewrite rules on my httpd.conf, this is the code , the problem is that apache not process files php with mod_php and I get a download request from my browser



<VirtualHost #*$!.#*$!.xx.#*$!:80> 
ServerName domainname.com:80 
ServerAlias *.domainname.com 
UseCanonicalName Off 
SuexecUserGroup domainname.com psacln 
DocumentRoot /var/www/vhosts/domainname.com/httpdocs 
CustomLog /var/www/vhosts/domainname.com/statistics/logs/ 
access_log plesklog 
ErrorLog /var/www/vhosts/domainname.com/statistics/logs/ 
error_log 

RewriteEngine on 

RewriteMap lowercase int:tolower 

# define the map file 
RewriteMap vhost txt:/var/www/vhosts/domainname.com/conf/ 
vhost.map 

# deal with aliases as above 
RewriteCond %{REQUEST_URI} !^/icons/ 
RewriteCond %{REQUEST_URI} !^/cgi-bin/ 
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ 
RewriteCond ${vhost:%1} ^(/.*)$ 
RewriteRule ^/(.*)$ %1/httpdocs/$1 

RewriteCond %{REQUEST_URI} ^/cgi-bin/ 
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ 
RewriteCond ${vhost:%1} ^(/.*)$ 
RewriteRule ^/(.*)$ %1/cgi-bin/$1 

<IfModule mod_userdir.c> 
UserDir /var/www/vhosts/domainname.com/web_users 
</IfModule> 
ScriptAlias /cgi-bin/ /var/www/vhosts/domainname.com/cgi-bin/ 
<IfModule mod_ssl.c> 
SSLEngine off 
</IfModule> 
<Directory /var/www/vhosts/domainname.com/httpdocs> 
<IfModule mod_perl.c> 
<Files ~ (\\.pl$)> 
SetHandler perl-script 
PerlHandler ModPerl::Registry 
Options ExecCGI 
allow from all 
PerlSendHeader On 
</Files> 
</IfModule> 
<IfModule sapi_apache2.c> 
php_admin_flag engine on 
php_admin_flag safe_mode off 
php_admin_value open_basedir "/var/www/vhosts/ 
domainname.com/httpdocs:/tmp" 
</IfModule> 
<IfModule mod_php5.c> 
php_admin_flag engine on 
php_admin_flag safe_mode off 
php_admin_value open_basedir "/var/www/vhosts/ 
domainname.com/httpdocs:/tmp" 
</IfModule> 
<IfModule mod_fcgid.c> 
<Files ~ (\\.fcgi)> 
SetHandler fcgid-script 
Options +FollowSymLinks +ExecCGI 
</Files> 
</IfModule> 
Options -Includes +ExecCGI 
</Directory> 
<Directory /var/www/vhosts/domainname.com/web_users> 
<IfModule sapi_apache2.c> 
php_admin_flag engine off 
</IfModule> 
<IfModule mod_php5.c> 
php_admin_flag engine off 
</IfModule> 
</Directory> 

</VirtualHost> 

this is the output header from live http firefox addon


http://testblog3.beta.domainname.com/

GET / HTTP/1.1
Host: testblog3.beta.domainname.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 GTB7.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: __utma=144577450.733310012.1274534938.1275728087.1275740583.8; __utmz=144577450.1274534938.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); wp-settings-2=m1%3Do%26m5%3Do%26m6%3Do%26m7%3Dc%26m8%3Do%26m2%3Do%26m0%3Dc; wp-settings-time-2=1275134637; wp-settings-4=m4%3Do%26m1%3Do%26m7%3Do%26m6%3Do%26m5%3Do%26m3%3Do%26m2%3Do%26m8%3Do; wp-settings-time-4=1275226306; wp-settings-time-1=1275232192; wp-settings-1=m10%3Do%26m1%3Do; __utma=31563181.1742254361.1275467841.1275680350.1275741920.7; __utmz=31563181.1275467841.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=225634463.1080680390.1275497952.1275497952.1275497952.1; __utmz=225634463.1275497952.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); wp-settings-5=m8%3Dc%26m7%3Dc%26m6%3Dc%26m5%3Do%26m1%3Dc%26m2%3Dc%26m3%3Dc%26m4%3Dc%26m0%3Dc%26m9%3Dc; wp-settings-time-5=1275497981; __utmc=144577450; LThttpwwwbloogit=24nurr069a4lckhtuteo21c503; __utmc=31563181; bb2_screener_=1275741833+84.223.175.156
Authorization: Basic YWRtaW46YWxleGZsYXNo
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Date: Sat, 05 Jun 2010 13:21:06 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 04 Jun 2010 21:19:47 GMT
Etag: "48a01da-1d2-4883ae1f122c0"
Accept-Ranges: bytes
Content-Length: 466
Connection: close
Content-Type: application/x-httpd-php


because this file is httpd.include in plek installation and I don’t modified httpd.conf file

You could still check to see if plek did it right. Look for that line DK posted (AddType)

I ont think that this is problem because this file is httpd.include in plek installation and I don’t modified httpd.conf file , sorry for my not complete information

Almost ALWAYS, that’s a problem with the LACK of a line in the httpd.conf (or Apache2.conf for Linux):

AddType application/x-httpd-php .php

You may also need the Linux equivalent of

LoadModule php5_module "C:/PHP/php5apache2_2.dll"

but I’ll let you check the sticky where Stomme poes relates her experience with loading Apache on a 'nix box.

Regards,

DK