How to create a temporary 302 redirect via htaccess

An easy way to create a temporary redirect from one page to another web page is to use the 302 redirect directive with an htaccess file. With a temporary redirect search engines are aware this is not going to be a permanent redirect and will continue to update their listing for it.


Create an .htaccess file and place the following contents at the top:

 RewriteEngine On

 Options +FollowSymLinks


Example:


Redirect 302 /article.html http://www.example.com/new-article.html


To redirect an entire website to a new url use the following:

Redirect 302 / http://www.thenewwebsite.com


Once created upload the file to your public_html folder with the file manager or any FTP program. If the file already exists you can insert the line to the top of that file instead.




Creating a temporary 302 redirect via .htaccess

  • 336 Users Found This Useful

Was this answer helpful?

Related Articles

Set CORS header to Allow Access for any Incoming Domain

The following may be used to set to always set the CORS header for any incoming domains without...

View your website in older browser versions

As developers and webmasters it is always important to make sure your website works in several...

How do I remove a web disk?

In Windows, go to My Network Places on your PC, find the connection, right click and delete....

Prevent CloudFlare from Loading a js or Script

Sometimes CloudFlare / Rocket Loader can have problems with a script and hose it up. To have...

When should I use ascii and when should I use binary?

Many FTP client programs support and auto mode to detect the proper upload type based on file...