Learning Media

how to redirect by htaccess

Written by Aman yadav

There is many method of redirecting  and only this method for redirecting is more suitable because in this time for redirecting is less , and not affect the meta data of website.In other methods like by php, meta refresh and javascript your time of redirection will take 1-2 sec , first go to same url and the redirect. So that’s why we use this htaccess method.

First what is htaccess ?

Full form of htaccess is “Hyper text access” . BY this website owner give permission of access the directory and pages , Sometime when we go to undefined url of website and page show 404 error , this is only done by this htaccess.

Now How to Use this ?

For using this you make a file with extension .htaccess and edit this according to your requirement like these

  • Redirect entire website to another domain

Redirect 301 / http://www.liveurlifehere.com/

This is 301 redirection link for more about this read here>>

  • Redirect entire website to another domain

Redirect 302 / http://www.liveurlifehere.com/

For more redirection from 302 read here >>

  • Redirect from index.php/html to specific directory

Redirect /index.html http://www.liveurlifehere.com/blog/

  • Redirect from one page to another page

Redirect /onedirectory/one.html http://liveurlifehere.com/blog/new.html

  • Redirect from 404 error  to specific page

ErrorDocument 404 /404.php

After that in this directory 404.php page must be there.

If you want to make this file in your pc then make in notepad and rename in host server by .htaccess

A2hosting
Uptime
Features
Support
Overall

Pros

  • Best Support
  • Low Price
  • 100% Uptime
  • Fast Speed Server

Cons

  • No Cons For this

About the author

Aman yadav

Article writer @ Liveurlifehere Blog : I am writing on Top trending article on web,technology-how to,entertainment,top n category post .I am always try to reach you diffrent & good quality content then ever.

Leave a Comment