Forums

htaccess help (1 post)

  1. f888
    Member
    Posted 2 years ago #

    hello everyone
    I have been trying to get this to work for several hours but I didn't make it
    I have made a script that works perfectly with standard urls like index.php?page_id=9&state=Oregon&city=Portland
    basically I need to have urls like
    http://www.homeinsuranceguides.com/home-insurance-quotes/Oregon/Portland/
    to be reweitten to http://www.homeinsuranceguides.com/home-insurance-quotes/?state=Oregon&city=Portland
    without being interpreted as standard posts
    my script is in the /home-insurance-quotes/ page (which is not a physical directory on the server) and this is one of the htaccess have tried, but didn't work (this one actually causes a server error)

    RewriteEngine On
    RewriteRule ^/?home-insurance-quotes/([-A-Za-z0-9_]+)/([-A-Za-z0-9_]+)/?$
    /home-insurance-quotes/?&state=$1&city=$2
    RewriteRule ^/?home-insurance-quotes/([-A-Za-z0-9_]+)/?$ /home-insurance-quotes/?state=$1
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    you can see it at http://www.homeinsuranceguides.com/, click the link at top right of the page
    I am using runphp to execute the script and it works fine without rewriting the urls

Topic Closed

This topic has been closed to new replies.

About this Topic