Forum Moderators: phranque

Message Too Old, No Replies

XAMPP mod rewrite results in blank page (for php)

but works for html!

         

yummybanas

1:05 am on Mar 15, 2006 (gmt 0)

10+ Year Member



I can't seem to make mod rewrite work for PHP on my local server.

here's my htaccess:


RewriteEngine On
#Options +FollowSymlinks
#Options Indexes FollowSymLinks
RewriteBase /
RewriteRule ^blah/?$ blah.html
RewriteRule ^blah2/?$ blah.php
RewriteRule ^admin/?$ admin_index.php

Very simple rule. But here are the results:

[subdomain3.localhost...] redirects fine to blah.html

[subdomain3.localhost...] redirects to a completely blank white page. (not 404)

[subdomain3.localhost...] gives me 404.

(I've also tried the same thing on [localhost...] btw)

I googled "mod rewrite blank page" and found this:


Bug Symptoms: Running Apache (2.2.0 distribution from xampp), with PHP 4, I was getting a blank page. My PHP application was using the Apache module "mod rewrite", it appeared directly related to the "rewrite" links.

Solution: Turned out that if I disable the Apache module "mod_status" it works just fine.

So I went to my httpd.conf and commented
#LoadModule status_module modules/mod_status.so
restarted apache, but still no luck. The php redirect gives me a blank page.

I uploaded my .htaccess and the files to an online server, and it redirects perfectly.

Has anyone ran to this problem with XAMPP? I'm a bit of a newbie but I've worked with apache for some time and I'm completely baffled.

jdMorgan

2:42 am on Mar 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Best guess: Try something like:

RewriteRule ^blah2/?$ /blah.php [T=application/x-httpd-php,L]

This tells the server to parse the file for PHP code.

Jim

yummybanas

3:24 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



Didn't work.

I switched to PHP5 on Xampp and now it works. Very strange.