N.Design Studio

301 .htaccess Redirect Trick

Filed in: Tricks & Tips Jump to comments

After the implementation of WordPress, you should notice some of the URLs and paths on this site are different. To prevent getting 404 File Not Found error (traffic coming from links, bookmarks and search engines), I used this .htaccess 301 redirect trick I found. This way is better than meta refresh or redirect tag because there is no delay as the browser reads the .htaccess file first. However, it is only available to Linux server (doen’t work on Window server). Here is the trick.

Go to your site’s root folder, download the .htaccess file to your local computer and edit it with a plain-text editor (Notepad). If you are using FTP Client software and you don’t see any .htaccess file on your server, double check your setting and make sure you have turn on invisible / system files.

To redirect certain page(s):

Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/

To redirect entire site:

Redirect 301 / http://www.new-site.com/

42 comments so far

Pages: « 5 4 [3] 2 1 » Show All

  1. Gravatar
    Free Article Directory
    # 22

    July 19th, 2008 at 2:25 am

    Thanks just what I was looking for!

  2. Gravatar
    energy certificate
    # 21

    July 18th, 2008 at 8:02 am

    nice article and helped :)

  3. Gravatar
    Dragos
    # 20

    May 23rd, 2008 at 11:00 am

    Nice article!

  4. Gravatar
    web design , almog , almog media
    # 19

    May 19th, 2008 at 9:05 pm

    This is really a good point , also helps with seo

  5. Gravatar
    Jack Keller
    # 18

    May 13th, 2008 at 12:40 am

    I am glad I found this, momentary brainfreeze after sending out a mass mailing for a client site that had a + at the end of a link, which the server didn’t know to just strip off - YIKES!

    A quick .htaccess search and I came across a few overly complex solutions, yours was the most effective!

    Thanks a ton.

  6. Gravatar
    Fabian
    # 17

    February 24th, 2008 at 1:29 pm

    Maybe you should use this code if you move your whole site:
    Redirect Permanent 301 / http://www.new-site.com/

  7. Gravatar
    Firefox
    # 16

    January 9th, 2008 at 7:59 am

    I’m experienced in SEO.
    I can tell you that this
    ::Redirect 301 / http://www.new-site.com/
    Is a bad way to redirect your site. You should use this code.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://z.com/$1[R=301,L]

  8. Gravatar
    vonchilliman
    # 15

    December 21st, 2007 at 12:01 pm

    Thank-you - Ideal information for me after renaming a page on my site :-)

  9. Gravatar
    Kyle
    # 14

    November 18th, 2007 at 9:19 pm

    Hi, wondering if i could use somthing like this to redirect all my Zip and rar files to my main page ? any info will be great thanks in advance.

  10. Gravatar
    Nate
    # 13

    September 15th, 2007 at 12:32 am

    2 minor mistakes in this tutorial:

    The server reads the .htaccess file, not the client (browser).
    And yes this trick will work under windows with Apache.

Pages: « 5 4 [3] 2 1 » Show All

Post your comment





Categories