Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Mod_Rewrite and SuPHP

Discussion in 'General Discussion' started by Will Webb, Apr 30, 2016.

  1. Will Webb

    Will Webb Registered

    Apr 30, 2016
    Likes Received:
    Trophy Points:
    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

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

    if ($id == "ID taken from the link URL") {$url =affiliate URL}   
    header("Location: $url");
    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.
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice