Tag Archives: Permanent Redirect

Creating Temporary And Permanent Redirects Using Apache

301 is a permanent redirect and 302 is a temporary redirect. 301 redirect is used when you want to redirect pages without penalizing them in search engines. And 302 redirect is used when you want to set up temporary redirect for keeping your page rank better in search engines. Learn more.

How To Set Up Permanent Redirect Using Apache ?

Open your site’s .htaccess file.

If there is no .htaccess redirect then create a new text file in your site’s root.

Add this line at the very end of your .htaccess file:

Redirect 301 /REDIRECT_PATH NEW_URL

Where:

REDIRECT_PATH = Directory path on your web server. And

NEW_URL = Is the path you want the pages redirected to.

Save the file and test your URL.

Example: 

Redirect 301 /tags/lamp/ https://www.sangkrit.net/tags/lamp/

How To Set Up Temporary Redirect Using Apache ?

Open your site’s .htaccess file.

If there is no .htaccess redirect then create a new text file in your site’s root.

Add this line at the very end of your .htaccess file:

Redirect 302 /REDIRECT_PATH NEW_URL

Where:

REDIRECT_PATH = Directory path on your web server. And

NEW_URL = Is the path you want the pages redirected to.

Save the file and test your URL.

Example:

Redirect 302 /tags/lamp/ https://www.sangkrit.net/tags/lamp/