/    Sign up×
Community /Pin to ProfileBookmark

Auto Forward Web Page

Hi all

I need some assistance in finding some code. I have redesigned my companies website and placed all new folders in a folder named “v2”, as in version 2.

I have looked on the internet for some code to auto forward users from the original site index to the new site index under the v2 folder.

Does anyone have a recommended solution?

Cheers

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@jogolApr 20.2007 — what about a .htaccess redirect?
Copy linkTweet thisAlerts:
@NogDogApr 21.2007 — Other options:

PHP header() redirect:
[code=php]
<?php
header('Location: http://www.yoursite.com/v2/index.php');
?>
[/code]

Meta refresh redirect:
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<!-- the next meta tag does the redirect -->
<meta http-equiv="refresh" content="3;url=http://www.yoursite.com/v2/index.php">
<title>Page Title</title>
</head>
<body>
<p>Our web site has moved. If you are not automatically redirected to it in
a few seconds, please click the link below, and don't forget to bookmark
the new location.</p>
<p><a href="http://www.yoursite.com/v2/index.php">Go to new location</a></p>
</body>
</html>
[/code]
×

Success!

Help @peteyb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...