Apache rewrite rules not causes a download dialog of the PHP file
Posted
by
Shaihi
on Server Fault
See other posts from Server Fault
or by Shaihi
Published on 2011-06-09T21:28:25Z
Indexed on
2011/06/24
0:24 UTC
Read the original article
Hit count: 496
I have Apache 2.2.17 using the WAMPServer 2.1
installation.
I am debugging a website fully local on my computer.
I have the following rule in the .htaccess:
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
Options +FollowSymlinks
RewriteEngine on
Rewritebase /
RewriteRule ^bella/(.*)/(.*)$ beauty.php?beauty_id=$1 [L]
RewriteRule ^(argentina|brasil|chile|colombia|espana|mexico|rep_dominicana|uruguay|venezuela|peru|bolivia|cuba|ecuador|panama|paraguay|puerto_rico)/$ country.php?name=$1 [L]
RewriteRule ^(argentina|brasil|chile|colombia|espana|mexico|rep_dominicana|uruguay|venezuela|peru|bolivia|cuba|ecuador|panama|paraguay|puerto_rico)/(hi5|facebook|twitter|orkut)/$ socialnetw.php?country=$1&category=$2 [L]
The problem
When I enable this rule and try to access http://localhost/index.php
using FF I get a download dialog for the PHP file. If I comment the Rewrite* part in the .htaccess file then the index.php file loads fine, but navigation in the page is broken...
© Server Fault or respective owner