SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tricky mod_rewrite

    I have a mod rewrite that has 2 parameters always present, category and page, it also has an unknown number of additional parameters.

    here is the url as entered into the browser...
    /news/sports/?var1=12&var2=15&xxx=43...

    i want to rewrite the url like this...
    index.php?category=news&page=sports&var1=12&var2=15&xxx=43&...

    this does the category/page but does not allow for additional params
    RewriteRule ^(.*)/(.*)/(?)$ index.php?category=$1&page=$2

  2. #2
    SitePoint Wizard Dean C's Avatar
    Join Date
    Mar 2003
    Location
    England, UK
    Posts
    2,906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not a very efficient way of doing mod_rewrite if you have an unlimited number of variables. Maybe the QSA flag (passes additional query parameters) would help.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    worked perfect, thanx.

    i didn't know there were optional QSA flags


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
  •