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/

49 comments so far

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

  1. Gravatar
    CORNx2
    # 49

    May 22nd, 2009 at 12:40 pm

    .htaccess files work for Apache web server installed on Linux, Mac or Windows

  2. Gravatar
    Kerwin
    # 48

    May 21st, 2009 at 9:57 pm

    very nice tip!

    but how come it aint working with mine too?

    i get 301 moved permanently even on my new domain. they are hosted on same server.

  3. Gravatar
    birthday sms
    # 47

    April 22nd, 2009 at 5:32 am

    I have used this method before and i try to use it now, but it seems not working…

    I have to find why.

    I want to redirect old joomla pages to new static html pages

  4. Gravatar
    Website Design Web Development Company
    # 46

    March 19th, 2009 at 7:52 am

    Great tips for the newbies

  5. Gravatar
    Lots Of Freebies
    # 45

    January 12th, 2009 at 6:42 pm

    Nice and clear cut tutorial. Very easy to follow.

  6. Gravatar
    Cristi
    # 44

    January 9th, 2009 at 10:17 am

    The browser doesn’t read the .htaccess file. The server does that.

  7. Gravatar
    AK Designs
    # 43

    December 3rd, 2008 at 8:38 am

    Fantastic you cut out all the rubbish that normally surrounds 301 redirects. thanks.

  8. Gravatar
    Computer Tips
    # 42

    November 29th, 2008 at 11:01 pm

    Great tips and it works. Yay!

  9. 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 ?

  10. Gravatar
    Jeff
    # 40

    November 28th, 2008 at 2:54 pm

    Yes works great thanks for the info.

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

Post your comment





Categories