.htaccess Question And A Folder?

Discussion in 'Apache' started by scm22ri, Feb 6, 2013.

  1. #1
    Hi Everyone,

    I'm trying to account for a folder in my htaccess. Meaning I want my URLS like below

    mydomain.com/dealers/florida/key_west

    My question is, I'm not quite sure what I'm doing wrong in my below syntax. How would I accurately account for the "dealers" folder?

    Below is my syntax. What am I doing wrong? Any help would be appreciated. Thank you.

    RewriteEngine On
    RewriteRule ^dealers/([_a-zA-Z]+)$ state.php?state=$1 [L]
    RewriteRule ^dealers/([_a-zA-Z]+)/([_a-zA-Z]+)$ city.php?state=$1&city=$2 [L]
    Code (markup):

     
    scm22ri, Feb 6, 2013 IP
  2. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    $state.php

    $city.php

    you had spaces there. cannot have spaces in a url string.
     
    cesurasean, Feb 19, 2013 IP