Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with a redirect page passing dynamic parameter results forward

    Hi

    I apologise if I have posted this thread in the wrong section, I think a php page is likely to be the best solution to my problem, but, I am open to suggestions.

    I am using a platform which generates affiliate referral links for it's registered users to refer affiliates and receive referral commission on their future earnings.

    The platform incorporates a default signup page (/mysite/signup) to which the default links are directed, but, I do not have access to any code on the default signup page.

    It is my intention to, at a later date, introduce a custom signup page, but, if I allow the use of existing links produced by the platform and later introduce the custom signup page, all existing inbound links would still direct to the default signup page which I would no longer be using.

    My thoughts to work around this are to introduce a redirect page which, for now, directs to the default signup page, but, when the custom page is introduced, I can just change the destination of the redirect to the custom page without affecting existing inbound links.

    I am able to recode the default referral url which in the platform is generated from: /mysite/signup/{affiliate_id}.

    So, my thoughts were to create a divert page called "register" and change the platform referral links to direct to it: /mysite/register/{affiliate_id}

    NOTE: The referral urls will not work correctly when received at /mysite/signup if the "affiliate_id" is not passed in as "/1002", this is where my problem begins as any simple redirect page I can produce naturally returns a 404 error as the page /mysite/register/1002 does not exist (and if it did, it wouldn't help for affiliate 1005).

    The referral link should direct to /mysite/register where the page identifies the appended "/1002" parameter and passes it into the redirect to /mysite/signup/1002.

    Any help would be greatly appreciated.

    I apologise if this is not entirely clear, I will happily supply any additional info needed.

    Thanks

    dazzyuk

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Links like this are not typically real: /mysite/signup/1002. That would indicate its loading a script called /mysite/signup/1002/index.php, and unless you want to clone tons and tons of index scripts, that's just not going to happen.
    This is done using apache mod_rewrite. A typical approach is to use the path to figure out the script and the id. So /mysite/signup/1002 is rewritten to go to /mysite/signup.php?r=1002 for example.
    I'm not sure why you are creating a second form for signup. When this script is complete, why not just overwrite the existing register scripts?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Fou-Lu

    Thanks for your comments.

    My web programming is virtually non-existent ( I can just about decipher html), so please forgive if I have misunderstood anything.

    The default signup page is within the network patform and I have no access to it's code or file. I will need to use a custom sign-up page at a later date as I wish to incorporate Photo ID upload within my custom form for application verification.

    As it stands, the link used to generate the affiliate referral links (/mysite/signup/{affiliate_id}) would give the referring affiliate a url which looks like /mysite/signup/1002), but, when clicked, it navigates to /mysite/signup and uses the appended "1002" affiliate ID to identify the applicants registration as having been referred by affiliate 1002.

    As you suggest, the link implies /1002/index.php which I dont believe exists within the networks files.

    I tried your suggested /mysite/signup.php?r=1002 as a direct link in a browser, but, this returned a 404 error, amending the link to /mysite/signup?r=1002 did navigate to the default signup page, but, the signup page did not recognise the appended affiliate ID.

    I have identified using Firefox view source that the default signup page is coded in html.

    I hope this helps

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Well no, that doesn't really help at all.
    Like I said, that would be an example. Unless the original site does indeed clone for each referral, which would be an absolutely silly thing to do, than rewrite is in use. I cannot tell you what your rewrite rules are, that would require you to go through the httpd.conf, .htaccess or the webconfig on an IIS server to figure out what that's doing.
    Still don't understand why you need two scripts. Is there never any intention of overwriting the existing one that's in place?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm confused regarding the 2 scripts.

    I assume (possibly wrongly) that you are indicating that 1 script is the existing default signup page, I have no write access to this file, though I can introduce an alternate signup file and ensure the platform produces links which navigate to it, however, that would leave existing promotional links on external sites navigating to the default signup page (and not the custom page).

    This is why I wish to produce 1 redirect page now which currently directs the user to the default signup page, but, can later be changed to direct to the custom page instead.

    I think I'm only after 1 script for the redirect page (though I recognise it may work in conjunction with other pages (javascript or php) to correctly handle the parameters and pass them on to the destination page).

    Thanks

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    So you can't get rid of an existing page, but you can create new ones? Not sure how that ever came about security wise.
    Use your rewrite rules for this. Since it likely has rewrite for the original document, then you simply modify it to specify a redirect to the new script.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •