How to redirect a page to another page or website using .htaccess?

If the page on your website is no longer exist and you want to redirect it to another page or website then you can use the .htaccess file to set up redirect.
Redirect from a page/directory to another domain or the main domain:
Redirect from a specific page to a domain:
RewriteEngine on
Redirect 301 /mypage.html
Redirect from a page to another page:
RewriteEngine on
Redirect 301 /oldpage.html /newpage.html
Now, whenever you open the url, it will automatically redirect you to

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I modify the permissions of my files or directories?

You can do that either via FTP (chmod, for more information please refer to your FTP client...

How to setup FTP client and upload files?

In this tutorial we will show you how to setup FileZilla FTP client to upload your files to our...

I have uploaded my files, why can't I see them?

Please always ensure that you have uploaded your files under the public_html folder.If you have...

How to create a user-friendly URL using .htaccess?

If your website is using long URLs, e.g., you can change it...

php error: Allowed memory size of x bytes exhausted

If you are getting an error "Allowed memory size of... in file /directory/folder/yourscript.php",...