Divi WordPress Theme

302 Redirect using PHP - temporary redirections

Topic: 302 Redirect using PHP - temporary redirections  (Read 26595 times)

Offline Kevin

  • Junior Guru
  • **
  • Posts: 69
  • iTrader: +4/-0
    • View Profile
302 Redirect using PHP - temporary redirections
« on: August 10, 2008, 04:06:37 PM »
Sometime, you may need to redirect your site to some other location. In such event, you may set 302 redirection (also called temporary redirection) using PHP code. Following is the sample 302 redirection using PHP:

Code: [Select]
<?php
header
("Location: http://www.your-web-site.com/temp-location/index.html");
exit();
?>


Kevin
« Last Edit: August 20, 2014, 05:39:10 PM by Kailash »
VPS Hosting - AccuWebHosting

Offline muckle.martin

  • Newbie
  • *
  • Posts: 5
  • iTrader: +0/-0
    • View Profile
Re: 302 Redirect using PHP - temporary redirections
« Reply #1 on: December 14, 2008, 01:11:42 PM »
Ignore my last message :)

Quote from: Kevin
Sometime, you may need to redirect your site to some other location. In such event, you may set 302 redirection (also called temporary redirection) using PHP code. Following is the sample 302 redirection using PHP:

Code: [Select]
<?php
header
(”Locationhttp://www.your-web-site.com/temp-location/index.html”);
exit();
?>


Kevin
« Last Edit: October 26, 2012, 07:14:44 PM by Kailash »

Offline ramsankeiio

  • New Member
  • *
  • Posts: 15
  • iTrader: +0/-0
    • View Profile
Re: 302 Redirect using PHP - temporary redirections
« Reply #2 on: October 15, 2010, 02:04:27 PM »
Sometime, you may need to redirect your site to some other location. In such event, you may set 302 redirection (also called temporary redirection) using PHP code.

Offline Web_news

  • New Member
  • *****
  • Premium Member
  • Posts: 43
  • iTrader: +5/-0
    • View Profile
Re: 302 Redirect using PHP - temporary redirections
« Reply #3 on: August 11, 2014, 07:10:19 PM »
If you have Apache web server with mod_rewrite support, you can also use following .htaccess rule for 302 redirection:

Redirect 302 /old_path new_rul_location

Example:

Redirect 302 /index.htm http://your_website/index.php
Shopify Divi WordPress Theme
Tags:

redirect to secure URL (https)

Started by AnonymousBoard .NET Development

Replies: 2
Views: 6062
Last post November 27, 2017, 06:26:53 PM
by neckozenica
Redirect the sub-domain on the Linux server (cPanel/WHM)

Started by KailashBoard How Tos

Replies: 0
Views: 10600
Last post July 04, 2007, 11:01:49 AM
by Kailash
Redirect Web Visitors By Country Using ASP & COM Technol

Started by TechBoard ASP

Replies: 0
Views: 5877
Last post September 30, 2007, 02:45:25 PM
by Tech
Temporary local problem - please try later Valid RCPT

Started by scottBoard cPanel/WHM

Replies: 1
Views: 5242
Last post August 04, 2008, 12:32:02 AM
by Kevin
301 Redirect using PHP - Permanent Redirect HTTP 301

Started by KevinBoard PHP

Replies: 1
Views: 6840
Last post December 14, 2008, 01:10:47 PM
by muckle.martin