|
|
|
|
Thread title: PHP Redirect |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
02-03-2007, 04:29 AM
|
#1
|
Status: Request a custom title
Join date: Apr 2006
Location: US
Expertise:
Software:
Posts: 2,802
|
PHP Redirect
I set up a PHP redirect so that when my visitors go to www.jamesh.us, it redirects them to www.jamesh.us/wordpress
When I'm linking my blog, should I post the URL as jamesh.us or jamesh.us/wordpress? I tried to do an .htaccess, but it wouldn't work at all:
Any ideas?
|
|
02-03-2007, 04:43 AM
|
#2
|
Status: Member
Join date: Aug 2005
Location: Melbourne, Australia
Expertise:
Software:
Posts: 419
|
If you want to do it in PHP you can just put the code at the top of your index page.
PHP Code:
header('Location: /wordpress');
exit();
|
|
02-03-2007, 05:05 AM
|
#3
|
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
Posts: 5,200
|
I would also link to your main site unless you are going to keep your blog directory the same forever.
|
|
02-03-2007, 06:58 AM
|
#4
|
Status: Request a custom title
Join date: Apr 2006
Location: US
Expertise:
Software:
Posts: 2,802
|
Alright, thanks for the suggestion Andrew and Sketch. I've gotten the PHP redirect working, and I'll just link to my main site for now in case I decide otherwise.
|
|
02-05-2007, 06:36 AM
|
#5
|
Status: Member
Join date: Feb 2006
Location: Ponca City, OK
Expertise: xHTML/CSS/PHP/Computer Tech
Software: Photoshop, Notepad++, Winamp
Posts: 332
|
Why not move wordpress to your root folder?
|
|
02-05-2007, 12:50 PM
|
#6
|
Status: Request a custom title
Join date: Feb 2005
Location: The Netherlands
Expertise:
Software:
Posts: 2,616
|
Originally Posted by mikeroq
Why not move wordpress to your root folder?
|
Thats what I would do, but the header redirect is also a good solution.
|
|
02-10-2007, 03:13 PM
|
#7
|
Status: I'm new around here
Join date: Feb 2007
Location:
Expertise:
Software:
Posts: 23
|
You can also use Javascript :
PHP Code:
<html>
<head>
<script language="JavaScript">
<!--
// author: Kirth
// description: redirects to where you want!
// necessary mods: change the '/forum' to where you want it to go to (I did it for you
window.location="/wordpress";
//-->
</script>
<head>
<title>Redirecting please wait...</title>
</head>
<body>
Hi there! Please wait while we redirect you!
</body>
</html>
|
|
02-17-2007, 05:02 PM
|
#8
|
Status: Dediport Hosting
Join date: Jul 2006
Location: Berkshire
Expertise: programming, business
Software: Dreamweaver
Posts: 1,316
|
I trhink window.location.href is better..
|
|
02-17-2007, 11:17 PM
|
#9
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
PHP Code:
echo"<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"0; URL=location.html\">";
|
|
02-17-2007, 11:27 PM
|
#10
|
Status: Senior Member
Join date: Aug 2005
Location: New York
Expertise:
Software:
Posts: 825
|
Originally Posted by Village Idiot
PHP Code:
echo"<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"0; URL=location.html\">";
|
Or, better yet:
PHP Code:
echo '<META HTTP-EQUIV="Refresh"
CONTENT="0; URL=location.html">';
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|