1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help Needed to Rewrite URL with htaccess / php / javascript

Discussion in 'Blogging' started by Claudiu, May 12, 2010.

  1. Claudiu

    Claudiu Regular Member

    Joined:
    Feb 28, 2009
    Messages:
    287
    Likes Received:
    81
    Location:
    127.0.0.1
    I have an html template that displays urls like: website.com/product.html?id=7 and i need to rewrite the url to a user friendly one like website.com/product/7

    I've managed to redirect the ugly url to nice url, but i get 404 error

    The urls are written through a javascript file.

    Since my knoledge on js, apache, php are very limited, i need your help.

    i'd appreciate some ideeas on why do i get 404 error and what solutions am i left with on making this work.

    htaccess (part of it)
    Code:
    rewritecond %{QUERY_STRING} ^id=(.+)
    RewriteRule ^product\.html$ http://website.com/%1? [R=301,L]
    
     
    Last edited: May 12, 2010