rewrite this url

Discussion in 'Apache' started by malchiang, Oct 4, 2007.

  1. #1
    malchiang, Oct 4, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)$ profile.php?user=$1 [L]

    Then again, you'll need a little help geting other stuff to work, unless there's some RewriteCond, or you have for example

    RewriteRule ^username/([^.]+)$ profile.php?user=$1 [L]
     
    Nintendo, Oct 4, 2007 IP
  3. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you would also need to make your website point to /username instead of profile.php?username as well, so that the rewrite rules are put into use.
     
    powerspike, Oct 5, 2007 IP
  4. malchiang

    malchiang Peon

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    wow so exactly how do I do all these at? Can you guys kindly put it step by step, thanks.
     
    malchiang, Oct 6, 2007 IP
  5. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nintendo has already stated what to do for the .htaccess (server side).

    Your application will need to point to the new location, because every application is different, we can't really tell you how do to it. would be like trying to find a needle in a haystack, with 50,000 haystacks to check =)
     
    powerspike, Oct 7, 2007 IP