To redirect your site using .htaccess, you can follow these steps:
- Open your website's root directory using an FTP client or file manager.
- Look for the .htaccess file. If it doesn't exist, create a new one.
- Edit the .htaccess file using a text editor.
- To redirect a specific page, use the following format:
Redirect 301 /old-page.html http://www.example.com/new-page.html
Replace /old-page.html with the path of the old page you want to redirect from, and http://www.example.com/new-page.html with the URL of the new page you want to redirect to.
If you want to redirect the entire website, use:
Redirect 301 / http://www.new-site.com/
Replace http://www.new-site.com/ with the URL of your new website.
- Save the changes and upload the .htaccess file back to your website's root directory.
- Test the redirection by accessing the old page or website URL.
Note: It's important to use the full URL in the new destination when redirecting to external sites with the
Redirect directive. If you want to redirect within the same domain, you can use relative paths instead.