main logo

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

Share
Try Medha Cloud for free
Click below to sign up and get $200 of credit to try our products over 60 days!
Contents
Surya Reddy
Surya works at Medha Cloud and has been there for two years. He's an expert in his field, and besides helping customers as a Technical Support Engineer, he also shares his insights through blogs. Always curious, Surya keeps an eye on the latest tech to stay ahead.

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

redirect page to another page or website using .htaccess

If a page on your website no longer exist and you want to redirect it to your new page or website then you can use the .htaccess file for redirection without waiting.

if 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 http://example.com

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

Now, whenever you open the url example.com/oldpage.html, it will automatically redirect you to example.com/newpage.html.

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Hosting Private Limited
#74, 7 Th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.