Htaccess help

Posted on 2009-02-19
Last Modified: 2012-05-06
We have an URL rotator script that grabs a random URL from a text file in the same directory. So when a visitor clicks on a link, they will get redirected to the randomly chosen URL.

Now we want to pass a variable along with the chosen URL, like this:

1) Visitor arrives at our site such as

2) Visitor clicks on a link on our page to

3) Random link is chosen and visitor is redirected to:

We'd like to do this as simply as possible, so if there is an .htaccess solution that might be best, or a session/cookie solution or else you can modify the randomurl script. We are also open to using a new randomurl script if that's easier. All it needs to do is allow us to enter multiple URLs to choose from, and then append the variable as previously described.
Question by:coolguy2009
    1 Comment
    LVL 10

    Accepted Solution

    Could you post the URL rotator script (I'm guessing it's PHP) and an example of the file of links?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now