SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Urgent Rewrite Help Required....

    this is what I have so far

    PHP Code:
    RewriteRule ^/?go/([A-Za-z0-9+]+)(/([A-Za-z0-9+]+))?/?$ go.php?aff=$1&r=$[L
    so at the minute the URL could be http://mysite.com/go/username

    or http://mysite.com/go/username/campaignname

    I'm wanting to add a third variable

    http://mysite.com/go/username?page=pagename

    or it could be http://mysite.com/go/username/campai...?page=pagename

    Can anyone lend a quick hand?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    wm,

    You've already got it as you can add another optional variable within the existing one like (/([A-Za-z0-9+]+)(/([A-Za-z0-9+]+))?)? and add the page key and $5 to the redirection - IF you would make your URL http://mysite.com/go/username/pagename! The way that you have it (adding a query string to the URL), merely add the QSA flag to the Last flag ([L] would become [QSA,L]).

    You might benefit from a read of the tutorial article in my signature as both are covered there.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

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