Buying wordpress .htaccess/mod rewrite puzzle $7

Discussion in 'Programming' started by tsoft, Dec 14, 2009.

  1. #1
    I have this wordpress say wpblogdummy.com. i want to be able to do something below thru .htaccess / mod_rewrite.

    Right now i have a url format like this:

    http://www.wpblogdummy.com/lawyers/?city=Auburndale
    http://www.wpblogdummy.com/lawyers/?city=Bartow
    http://www.wpblogdummy.com/lawyers/?city=Apopka

    where city is a $_GET variable.

    how do i change the .htaccess file so that it will look something like:

    http://www.wpblogdummy.com/lawyers/city/Auburndale
    http://www.wpblogdummy.com/lawyers/city/Bartow
    http://www.wpblogdummy.com/lawyers/city/Apopka

    NOTE:

    WORDPRESS IS MY PLATFORM.
    http://www.wpblogdummy.com/lawyers is a page.

    current rewrite rule is:

    Quick 7 bucks for the first come to come up with the right solution. You can PM me your post the solution here.
     
    tsoft, Dec 14, 2009 IP
  2. Gamerz7

    Gamerz7 Well-Known Member

    Messages:
    407
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Try this:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule /lawyers//(.*)/(.*)/$ /lawyers/?$1=$2
     
    Gamerz7, Dec 14, 2009 IP
  3. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    RewriteEngine On
    RewriteBase /
    RewriteRule ^lawyers/city/([a-zA-Z_]+)$ http://www.wpblogdummy.com/lawyers?city=$1 [L]
     
    kp_mastermind, Dec 14, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule /city/(.*)/$ index.php?city=$1

    use this
     
    Bohra, Dec 14, 2009 IP
  5. ilook

    ilook Well-Known Member

    Messages:
    1,602
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #5
    I have this standard on my hosting, no need to change :)
    What hosting do you have tsoft?
     
    ilook, Dec 14, 2009 IP
  6. twhc

    twhc Guest

    Messages:
    176
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^lawyers/city/([a-zA-Z_]+)$ /lawyers?city=$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
    twhc, Dec 14, 2009 IP
  7. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    already posted by me i guess, I am the winner !

     
    kp_mastermind, Dec 14, 2009 IP
  8. tsoft

    tsoft Active Member

    Messages:
    609
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    This one worked. Congratulations. There's a slight problem though. The URL turns ugly again when viewed on the address bar. If you can tell me what mod rewrite flag to put so it will turn ugly again that would be awesome. Anyway, send over your pp.

    Thanks.
     
    tsoft, Dec 15, 2009 IP