How would redirect one page to another page or even website using .HTAcess?

You are here:
  • Main
  • Others
  • How would redirect one page to another page or even website using .HTAcess?
← All Topics

If some page on the website is not existing, and you need to redirect it to another page or even the website then a user can use the .htaccess file for redirection without wasting a minute.

Redirect from a page/directory to another domain or the main domain:

Redirect from one page to another domain:
RewriteEngine on
Redirect 301 /mypage.html http://example.com


Redirect from one page to another page

Redirect from a page/directory to another page
Redirect 301 /oldpage.html /newpage.html


so, when you open the url example.com/oldpage.html, it would automatically redirect you to new page such as example.com/newpage.html.