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

Need help with htaccess

Discussion in 'General Scripting Chat' started by mightybh, Apr 26, 2009.

  1. mightybh

    mightybh Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 27, 2008
    Messages:
    1,029
    Likes Received:
    1,714
    Occupation:
    CEO
    Location:
    UK
  2. davejug1

    davejug1 Guest

    In the simplest term it is :

    Code:
    redirect 301 /old/old.html http://www.new.com/new.html 
    So in youe example it would be :

    Code:
    redirect 301 /2009/02/blog-post-name-example http://www.mydomain.com/blog-post-name-example.php
     
    • Thanks Thanks x 1
    Last edited by a moderator: Apr 26, 2009
  3. mightybh

    mightybh Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 27, 2008
    Messages:
    1,029
    Likes Received:
    1,714
    Occupation:
    CEO
    Location:
    UK
    Yea, this is what I was doing until I realized I have to go through 500 or so pages.
     
  4. davejug1

    davejug1 Guest

    Well mate you got me, never had to do such a large amount as that
     
  5. codine

    codine Junior Member

    Joined:
    Nov 22, 2008
    Messages:
    172
    Likes Received:
    9
  6. digdugg

    digdugg Junior Member

    Joined:
    Jun 1, 2009
    Messages:
    107
    Likes Received:
    19
    Location:
    The Milky Way Galaxy
    you can also redirect the directory...

    redirect 301 /2009/02 hoop://www dot mydomain dot com/feb/posts
    are your original links down or not working now or you just trying to redirect them all? you could even do all posts in 2009 will redirect to new domain archives or new domain welcome page welcoming those visitors and informing them of the new domain.
     
  7. mortenb

    mortenb Newbie

    Joined:
    May 21, 2009
    Messages:
    9
    Likes Received:
    0
    Something like this

    RewriteEngine On
    RewriteRule ^([0-9]{4})/([0-9]{2})/(.+)/?$ /$3.php [R=301,L]