What's wrong with my URL Rewrite?

Discussion in 'General Scripting Chat' started by luizeba, Dec 2, 2009.

  1. luizeba

    luizeba Regular Member

    Joined:
    Dec 24, 2008
    Messages:
    458
    Likes Received:
    176
    Occupation:
    Studant
    Location:
    Brazil
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteMatch 301 ^view/(.*)/(.*)/.htm$ view/$1/$2\.html [L]


    OR


    Options +Indexes
    Options +FollowSymLinks
    RewriteEngine on
    RedirectMatch 301 (.*).htm$ $1.html



    It's for my site: http://luizjogos.com/



    I want (for example)

    http://luizjogos.com/view/759/Defenda-o-Castelo.htm

    to go to

    http://luizjogos.com/view/759/Defenda-o-Castelo.html



    FIRST CODE: My site has a 'Internal Server Error'

    SECOND CODE: http://luizjogos.com/view/783/Rally-de-Portugal.htm to http://luizjogos.com/view/783/Rally-de-Portugal.html?task=view&id=783&name=Rally-de-Portugal



    I will love you forever if you can help
    I already read all the threads here in DP...but I can't figure what to do...

    Thanks guys!
     
  2. showboytridin

    showboytridin Regular Member

    Joined:
    Sep 5, 2009
    Messages:
    348
    Likes Received:
    716
    Location:
    127.0.0.1
    That should work. It depends on your original link. Be sure that you put the code on the .htaccess file and have the Apache module mod_rewrite installed on your server.