Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess mod_rewrite questions

    I tried looking at documentation on the mod_rewrite forums but this stuff is like chinese to me!

    I'm trying to change my links from

    http://www.karinne.net/archive/?bid=9

    to something like

    http://www.karinne.net/archive/make-your-html-efficient/

    I don't even know where to start ... what to put in my .htaccess file.

    Help!? Thanks!
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Create a .htaccess file and place it in your document root. and add the following
    Code:
    ReWriteEngine on
    RewriteBase /
    
    # don't allow anyone to view your htaccess file
    ReWriteRule \.htaccess [F]
    
    RewriteRule ^(.*)/(.*)/$ /index.php?archive=$1&bid=$2  [L]

    In your index.php, do the following

    Code:
    $archive = $_GET['archive'];
    
    $bid= $_GET['bid'];
    That should do the trick.

    Cheers,
    Ess

  • #3
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks ... I'll try that!
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

  • #4
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Alright ... I finally had time to play with this but ... didn't work.

    I still get stuff like http://www.karinne.net/archive/?bid=6 in my location bar
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •