HTACCESS rewrite for dynamic site

Discussion in 'Site & Server Administration' started by qbty, Jan 25, 2009.

  1. #1
    I know I know, it has been asked a lot but this is a bit different.

    I am looking for a .htaccess rewrite code to rewrite a dynamic path (/profile_view.php?editid1=2281) to a static line.... I know there is a lot of information out there to get it done automatically, but because of the current circumstances I am looking to do it manually...

    Basically I am transferring some tables and would rather create static content pages. SO I need to redirect each table entry to its own path, soon to be created by me.

    Basically my current redirect cannot redirect beyond /profile_view.php . So if there is an exception to include the remainder that would be awesome.

    Thanks in advance.
     
    qbty, Jan 25, 2009 IP
  2. yonghoshin

    yonghoshin Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    To change:

    yoursite.com/profile_view.php?editid1=2281

    to:

    yoursite.com/profile/2281/

    Use this:

    RewriteBase /
    RewriteRule ^profile/([^/\.]+)/?$ profile_view.php?editid1=$1 [L]
     
    yonghoshin, Jan 25, 2009 IP
  3. qbty

    qbty Peon

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3

    Thank you Yonghoshin, however that is not quite what I Am trying to do.

    What I am trying to do is redirect:

    mysite.com/profile_view.php?editid1=2281

    to

    mysite.com/section/category/page_title....

    realistically the variables in my current path do not contain enough information to do what I am trying to attempt. So I will manually be redirecting all the records in my database one by one....


    so how do I:

    Redirect 301 /profile_view.php?editid1=2281
    http://www.mysite.com/some_path/

    When I use this redirect it drops ?editid1=2281 and won't redirect it.

    hopefully this is a better illustration of what I am trying to do.

    ty
     
    qbty, Jan 25, 2009 IP