SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    301 htaccss redirection using wildcards


  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Perundurai, Tamilnadu, India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May be you try this

    Code:
    RewriteCond %{QUERY_STRING} p=forum/(.*?)\&postcount=(.*)
    RewriteRule showpost.php /forum/showpost.php?p=%1&postcount=%2 [R=301,L]

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tamilsuresh View Post
    May be you try this

    Code:
    RewriteCond %{QUERY_STRING} p=forum/(.*?)\&postcount=(.*)
    RewriteRule showpost.php /forum/showpost.php?p=%1&postcount=%2 [R=301,L]
    Hai tamilsuresh

    Thank you!
    i really forogot to mention that some part of url is dynamic and you spoted that

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Perundurai, Tamilnadu, India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hope my solution solved your problem, mark the post as solved

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

    Please note that the & in the query string regex need not (should not) be escaped. Since the query's values are digital, I'd also use ([0-9]+) for both atoms rather than (.*?) and (.*) ... let mod_rewrite do some error checking for you!

    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
  •