Skip to main content

Problems with PHP Header Redirect

Recently I was writing a PHP script which required a bit of code to redirect a user from the current page to another one.  This is achieved using the following code:

<?php
header("Location:http://www.othersite.com/otherpage.html");
?>

Unfortunately, however, I could not get this to work for me.  I tried every suggestion and tip I could find on the web to no avail.  Many sites advised making sure to remove any “white space” in the PHP file.  I removed every single bit except the 3 lines listed above, deleted the fourth blank line by going to the end of the third and hitting delete.  No joy.

I got in contact with my fantastic web hosting company Webhost.ie and they figured it out.  By default PHP on their servers runs at PHP4.  As soon as the version running was changed to PHP5 in the website settings area the script ran perfectly!

So there you go: if you’re having trouble with PHP header redirects check the PHP version number running on your web server.  You might need to update it to version 5.  Also, if you need reliable web-hosting with fantastic support I highly recommend you check out www.webhost.ie.  I’m not in any way related to their business, just a happy customer.

Comments

Popular posts from this blog

Where are SCANPST.EXE and/or SCANOST.EXE?

I sometimes have to deal with customer computers whose Outlook PST or OST files have become corrupted.  Very often the fix is to run SCANPST.EXE on the offending PST/OST file.   However, every time I go to do this I forget where the two executable files are.  Here is where they are on a Vista machine running Office 2007: C:\Program Files\Microsoft Office\Office12 I hope this helps.

WSUS Issues

Was configuring WSUS on a Server 2016 VM for a customer recently and found the performance to be very sluggish and most of the time the client PCs would time-out and throw an error message when trying to check for updates. After much digging on different forums I came across a fix that worked nicely: Open Internet Information Services (IIS) Manager and click on Application Pools Then Right-Click on your WsusPool instance and choose Advanced Settings Scroll down to Private Memory Limit (KB) and change it from the default of 1843200 to 0 which means unlimited. Then right-click and stop the WsusPool and then start it again. Hope this works for you.

SNMP on HPE Aruba Switches

After installing a number of HPE/Aruba CX switches I was finding that they were completely unresponsive to SNMP requests. Went through the config and couldn't see anything... Eventually found that you need to configure this line in order for the SNMP service to run: snmp-server vrf default Don't forget to do a "wr mem" afterwards!