Mod Rewrite and Redirection

Discussion in 'Programming' started by egjeff4, Mar 28, 2008.

  1. #1
    I have this site, that i'm trying to work on the mod rewrite rule for.

    the current links look like this: http://www.njlawyerpages.com/company_name.php?id=493

    I am trying to get the links to look like:
    http://www.njlawyerpages.com/company_name-id-493.html, which works fine with this .htaccess code:

    Options +FollowSymLinks
    RewriteEngine on

    RewriteRule -id-(.*)\.html company_name.php?id=$1

    The problem is, i don't want to go to every page, to change the URL structure....is it possible to redirect all the old pages: http://www.njlawyerpages.com/company_name.php?id=493 to go to the new url structure?
     
    egjeff4, Mar 28, 2008 IP