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/

52 comments so far

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

  1. Gravatar
    Computer Tips
    # 42

    November 29th, 2008 at 11:01 pm

    Great tips and it works. Yay!

  2. Gravatar
    Rohit
    # 41

    November 29th, 2008 at 2:45 am

    I m trying to redirect a link(contains some parameters along with) in my site. but its not taking ir properly.
    tell me, if in old and new URLs no. of parameter should be equal ?

  3. Gravatar
    Jeff
    # 40

    November 28th, 2008 at 2:54 pm

    Yes works great thanks for the info.

  4. Gravatar
    John
    # 39

    November 24th, 2008 at 7:29 pm

    Yes it does work on my site as well.
    It does work I use it on my site www.canvastown.com

  5. Gravatar
    decapper
    # 38

    November 21st, 2008 at 4:18 am

    Hello I was trying to redirect web 404 back to my home page http://www.pricelessweddings.com.au

  6. Gravatar
    andy
    # 37

    November 15th, 2008 at 11:26 am

    It does work I use it on my site http://www.banksyunmasked.co.uk
    Make sure you put the file in the right place or you will get an internal server error.

  7. Gravatar
    Marshall Reeves
    # 36

    November 10th, 2008 at 11:18 am

    Works very well - my indexed content deprecates appropriately, thanks! + Marshall Reeves

  8. Gravatar
    termal
    # 35

    November 3rd, 2008 at 5:18 pm

    I tried on my site and did it. Thanks for the code.

  9. Gravatar
    delilek online
    # 34

    October 31st, 2008 at 10:29 pm

    Great, I tried it on my site and it did work.
    Thank you for this code.

  10. Gravatar
    Social Networking Website for Charity
    # 33

    October 28th, 2008 at 1:42 pm

    Wowwww simply fantastic, these info will be useful for my site.

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

Post your comment