0

I've created the following Nginx Rewrite:

rewrite ^/([0-9A-Za-z]*)$ /index.php?redirect_reference=$1;

Then in my index.php I have:

<?php

        echo $redirect_reference . "\r\n";

There is no output for the value of $redirect_reference. I am unsure and need help.

I am setting up a sub-domain like redirect.example.com and wanting to use redirect.example.com/12345 so a minimum number of characters is used in sharing a link on social media posts.

For URLs such as redirect.example.com/12345 the number will be used to query the database for link 12345. Then I will query the database for the link 12345 represents and use the PHP header function to redirect to the requested web page.

For all others (such as fishing attempts) I want to setup a redirect to the home page IE www.example.com.

2
  • 3
    Check $_GET['redirect_reference'] Commented Jan 19 at 9:38
  • @IvanShatsky That escaped me when programming yesterday. Thanks. Commented Jan 19 at 14:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.