philaweb
09-17-2005, 06:34 AM
Perhaps this is not the right forum since my question also involves Apache server settings, but here goes:
For a long time I have used this fairly simple PHP code to redirect:
<?
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: $url_name" );
?>
I also have this piece of code to detect different environment variables when testing applications:
<html>
<title>User Agent Detector</title>
<body>
<?php
print "User agent: $HTTP_USER_AGENT";
?>
<br />
<?php
print "Language: $HTTP_ACCEPT_LANGUAGE";
?>
<br />
<?php
print "Remote address: $REMOTE_ADDR";
?>
<br />
<?php
print "Referer: $HTTP_REFERER";
?>
</body>
</html>
Both examples works fine on Linux and FreeBSD operated webhosts I use and have used in the past.
This week I set up a MacOS X 10.4.2 server and got everything to work - except the above code. All Apache modules are enabled, still no go. According to my web logs the files are loaded but nothing happens, no redirect just a blank page with complete redirect URL in browser status bar, the second example gives a page with four lines of text, no environment variables though.
Does anyone know what I am missing here?
Is it PHP related or Apache server related?
For a long time I have used this fairly simple PHP code to redirect:
<?
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: $url_name" );
?>
I also have this piece of code to detect different environment variables when testing applications:
<html>
<title>User Agent Detector</title>
<body>
<?php
print "User agent: $HTTP_USER_AGENT";
?>
<br />
<?php
print "Language: $HTTP_ACCEPT_LANGUAGE";
?>
<br />
<?php
print "Remote address: $REMOTE_ADDR";
?>
<br />
<?php
print "Referer: $HTTP_REFERER";
?>
</body>
</html>
Both examples works fine on Linux and FreeBSD operated webhosts I use and have used in the past.
This week I set up a MacOS X 10.4.2 server and got everything to work - except the above code. All Apache modules are enabled, still no go. According to my web logs the files are loaded but nothing happens, no redirect just a blank page with complete redirect URL in browser status bar, the second example gives a page with four lines of text, no environment variables though.
Does anyone know what I am missing here?
Is it PHP related or Apache server related?