Custom URL help. i want example.com/user not example.com/profile.php?recid=2

Discussion in 'Programming' started by xceedbd, Mar 1, 2010.

  1. #1
    xceedbd, Mar 1, 2010 IP
  2. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #2
    maybe like wordpress permalink
     
    xceedbd, Mar 1, 2010 IP
  3. jonmaster

    jonmaster Peon

    Messages:
    181
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    google, URL rewrite in php

    I do this in asp and asp.net
     
    jonmaster, Mar 1, 2010 IP
  4. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #4
    Sky AK47, Mar 1, 2010 IP
  5. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    NeoCambell, Mar 4, 2010 IP
  6. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #6
    Sky AK47 thanks for ur help.
    can i do it using any scripting language.
    any one can help
     
    xceedbd, Mar 29, 2010 IP
  7. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #7
    Erhm...I didn't fully get your question. Just use mod_rewrite in your htaccess and you can check the GET parameters with eg. PHP.
     
    Sky AK47, Mar 29, 2010 IP
  8. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #8
    this is my code. i dont know where the problem

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /socialbio/
    RewriteRule ^(.*)\.html$ profile.php?recid=$1 [L]

    my base folder RewriteBase /socialbio/

    i upload the .htaccess in the socialbio folder.

    there main one problem i send recid(profile.php?recid=)
    but i want /socialbio/username

    it possible.
     
    xceedbd, Mar 29, 2010 IP
  9. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #9
    Create an .htaccess file in the root folder and add the following:

    
    RewriteEngine On
    Options +FollowSymlinks
    
    RewriteRule ^profile/([0-9]+)\.html$ ./profile.php?recid=$1 [L,NC]
    
    Code (markup):
    This will give an output like example.com/profile/2.html

    Not tested but should work.
     
    nimonogi, Mar 29, 2010 IP
  10. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #10
    xceedbd, Mar 30, 2010 IP