Will Webb

Registered
Apr 30, 2016
1
0
1
Bristol, UK
cPanel Access Level
Root Administrator
I am trouble shooting a problem with my site. My affiliate links are processed through a mod_rewrite. The rule runs a php script which then forwards the visitor to the desired URL. After migrating to a shared VPS with Godaddy it no longer works. The link URL just shows in the browser address bar and the forwarding script does not work.

Here are the details of my set up.
CentOS & cPanel
php 5.5
suPHP is the handler being used
AllowOverride ALL is enabled (by default I believe)
RewriteEngine On (in .htaccess)

This is the rule in my .htaccess

Code:
RewriteEngine On
RewriteRule ^take_me_to/([/_0-9a-zA-Z-]+)?$ includes/go.php?id=$1
This is what's in my go.php file

Code:
<?php
if ($id == "ID taken from the link URL") {$url =affiliate URL}   

header("Location: $url");
    exit();
?>
I figure it must be something with how the rewrite is being done, or how the script is being run, or how the header is being handled.

Can anyone help with this. Hopefully I've given enough detail.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

As far as the server environment, are you using a different version of Apache, or a different PHP handler, compared to the previous server?

Thank you.