Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4079152
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:45:54+00:00 2026-05-20T17:45:54+00:00

Looking for some help in regards to getting my site to understand a link

  • 0

Looking for some help in regards to getting my site to understand a link used in an email which has a few $_GET vars to display neatly on the address bar.

The email is part of a marketing email campaign and sent out to a lot of addresses, the link in the email is dynamic and takes embedded information from the email to populate the $_GET vars.

I.e. http://www.foobar.com?page=twenty2talk&name=Joe Bloggs&position=director&company=The Butchers&telephone=000&email=joe.bloggs@thebutchers.co.uk

So with the above link example used inside the emails the user clicks on that and is directed to our website as per the norm.

What I am having trouble with is then converting that information (where the $_GET vars content will always change) via mod re_write.

In my .htaccess file I have the following RewriteRule in place.

RewriteRule ^twenty2talk$       index.php?
                                  page=twenty-2-talk
                                  &name=$1
                                  &position=$2
                                  &company=$3
                                  &telephone=$4
                                  &email=$5 [L]

I’m hoping I have not missed out any key information, but if so please give me a telling off.

Thanks in advance,

Dan.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:45:55+00:00Added an answer on May 20, 2026 at 5:45 pm

    Querystring append

    I’m assuming your links in the e-mail look like this

    www.foobar.com/twenty2talk?name=Joe Bloggs&position=director&
        company=The Butchers&telephone=000&email=joe.bloggs@thebutchers.co.uk
    

    and you want to get to this underlying URL

    www.foobar.com/index.php?page=twenty2talk&name=Joe Bloggs&position=director&
        company=The Butchers&telephone=000&email=joe.bloggs@thebutchers.co.uk
    

    (Linebreaks inserted only for clarity.)

    If you really needed to match stuff inside the query string (the stuff after ?), you could, but not using RewriteRule alone. Luckily you don’t need to. There’s something called querystring append in mod_rewrite that lets you just add something to the existing query string.

    RewriteRule ^twenty2talk/?$       index.php?page=twenty-2-talk [QSA,L]
    

    That rule adds page=twenty-2-talk but also keeps name etc untouched. The /? part allows for the start URL to be written with or without a trailing slash, which is good practice. The question mark literally means “match the previous character 0 or 1 time”.

    If you have several such campaigns, you could write a more dynamic rule:

    RewriteRule ^(twenty2talk|winfreebeer|wowamazing)/?$ index.php?page=$1 [QSA,L]
    

    In this particular example, twenty2talk wille be rewritten to page=twenty2talk without hyphens, rather than page=twenty-2-talk. But that’s OK – just check for both in the PHP code.

    For the future – a catch-all rule

    In the future I’d recommend using a special virtual “folder” for all campaigns, which would allow for a catch-all rule.

    RewriteRule ^campaigns/([^/]+)/?$ index.php?page=$1 [QSA,L]
    

    That rule will catch

    www.foobar.com/campaigns/twenty2talk?name=...
    www.foobar.com/campaigns/winfreebeer?name=...
    www.foobar.com/campaigns/wowamazing?name=...
    

    etc. so you don’t need to rewrite the .htaccess file for each campaign.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for some help with regards to SL4 and unit testing. Is
Looking for some help with a Labview data collection program. If I could collect
Hi I'm looking for some help in mapping the following tables to a hibernate
I'm looking for some help on my discussion. We're discussing two solutions to a
I'm looking for some help with a dependency issue. In a nutshell, I've included
HI, I am new to the scrum methodology and looking for some help to
I'm looking for a tutorial, blog entry, or some help on the technique behind
I am looking for some help with ReadAsDataContract in WCF REST. I found screencast
I am having trouble making this work and am looking for some help. Currently
Please forgive me if this has been answered before. I'm looking for some advice

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.