Urgent mydomain.com/m/1 to mydomain.com/m/1.html Please help

Discussion in 'Apache' started by sarathy, Apr 3, 2006.

  1. #1
    Hi Guyz, iam trying to 301 redirect:

    mydomain.com/m/1 to mydomain.com/m/1.html

    The number is dynamic, like
    mydomain.com/m/2 to mydomain.com/m/2.html
    mydomain.com/m/3 to mydomain.com/m/3.html

    How do i do it through .htaccess so that the urls automaticall redirects

    Pls help

    Thanks a lot

    Sarathy.s
     
    sarathy, Apr 3, 2006 IP
  2. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Just Try:

    RewriteEngine on
    RewriteRule ^/m/([0-9]*)$ http://mydomain.com/m/$1.html [R=301,L]


    Regards
     
    sacx13, Apr 3, 2006 IP
  3. Mozzer

    Mozzer Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,
    Sorry I can't directly help you, as of yet I haven't learn't all the in and outs of htaccess files however I found this link which does what you want.

    http://www.webmaster-toolkit.com/mod_rewrite-rewriterule-generator.shtml
     
    Mozzer, Apr 3, 2006 IP
  4. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks at lot sacx13 , that code helped me :). Thanks Mozzer for your link :) ., But That generator does not produce any code

    Sarathy.s
     
    sarathy, Apr 3, 2006 IP