Small help in .htaccess with PHP URL rewrite

Discussion in 'PHP' started by rahulsingh, Aug 20, 2008.

  1. #1
    Hi
    all i need a small help i have URL like this http://www.websitename.com/index.php?pageid now i want this URL like this http://www.websitename.com/pageid/ can any one provide me htaccess code for it :confused:

    currently i have htaccess file with this code its for www setings
    ===================
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
    ==================

    Thanks
     
    rahulsingh, Aug 20, 2008 IP
  2. William[ws]

    William[ws] Peon

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    add
    
    RewriteRule /pageid/ http://www.websitename.com/index.php?pageid [L]
    
    Code (markup):
    works perfectly
     
    William[ws], Aug 20, 2008 IP
  3. lovelycesar

    lovelycesar Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here is .htaccess file
     
    lovelycesar, Aug 20, 2008 IP