Doubt on .htaccess mod rewrite

Discussion in 'Apache' started by kks_krishna, Dec 22, 2011.

  1. #1
    HI,

    I have a website in the following address:
    www.blogdesign.com/samples/12-sample-design.html

    The above URL is old one. I have changed the URLs after update on the blog software. New URL would look like as follows:
    www.blogdesign.com/examples/2011/02/10/sample-design/

    I have the .htaccess file in the path www.blogdesign.com/samples/. Now I want to redirect all the traffic coming to www.blogdesign.com/samples/ to www.blogdesign.com/examples/ (i need redirection for each url separately. I have mapped the old url and new url)

    Can you please help me to get the correct redirection. I have tried the following. but, its not working.:

    RewriteRule ^237-what-is-objects.html(.*)$ /examples/2010/12/03/what-is-objects/

    Please help me.
     
    kks_krishna, Dec 22, 2011 IP
  2. Sensei.Design

    Sensei.Design Prominent Member

    Messages:
    3,847
    Likes Received:
    162
    Best Answers:
    0
    Trophy Points:
    310
    Digital Goods:
    1
    #2
    You'll need the following code:

    
    RewriteEngine On
    Redirect 301 /samples/ /examples/
    
    Code (markup):
     
    Sensei.Design, Dec 23, 2011 IP