Knowledge Base

How To Create a Temporary Redirect With .htaccess

How to Set Up a Temporary Redirect Using .htaccess

Follow these steps to set up a temporary redirect for your website using the .htaccess file.


1. Login to Your Control Panel or FTP

Access your website’s control panel or use an FTP client to manage files.

2. Open the File Manager or Connect via FTP

Navigate to the File Manager section in your control panel or establish an FTP connection.

3. Locate the public_html Directory

Go to your website’s main directory, usually named public_html.

4. Edit or Create the .htaccess File

  • Open the existing .htaccess file.
  • If it doesn’t exist, create a new one in the public_html directory.

5. Add the Redirect Code

Insert the following code to temporarily redirect your website:

   # 302 Redirect is temporary. Replace domain.com with your destination domain.
   Redirect 302 / https://domain.com/

6. Save the File

Save the .htaccess file and refresh your website to see the changes.


Your website will now redirect visitors to the specified domain.

Please rate this article to help us improve our Knowledge Base.

0 0