Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1822 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP Redirect

Thread title: PHP Redirect
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
02-03-2007, 04:29 AM
#1
JamesH is offline JamesH
JamesH's Avatar
Status: Request a custom title
Join date: Apr 2006
Location: US
Expertise:
Software:
 
Posts: 2,802
iTrader: 7 / 100%
 

JamesH is on a distinguished road

  Old  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
Sketch is offline Sketch
Sketch's Avatar
Status: Member
Join date: Aug 2005
Location: Melbourne, Australia
Expertise:
Software:
 
Posts: 419
iTrader: 0 / 0%
 

Sketch is on a distinguished road

  Old

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
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

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
JamesH is offline JamesH
JamesH's Avatar
Status: Request a custom title
Join date: Apr 2006
Location: US
Expertise:
Software:
 
Posts: 2,802
iTrader: 7 / 100%
 

JamesH is on a distinguished road

  Old

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
mikeroq is offline mikeroq
mikeroq's Avatar
Status: Member
Join date: Feb 2006
Location: Ponca City, OK
Expertise: xHTML/CSS/PHP/Computer Tech
Software: Photoshop, Notepad++, Winamp
 
Posts: 332
iTrader: 5 / 100%
 

mikeroq is an unknown quantity at this point

Send a message via AIM to mikeroq Send a message via MSN to mikeroq Send a message via Yahoo to mikeroq

  Old

Why not move wordpress to your root folder?

02-05-2007, 12:50 PM
#6
Sam Granger is offline Sam Granger
Status: Request a custom title
Join date: Feb 2005
Location: The Netherlands
Expertise:
Software:
 
Posts: 2,616
iTrader: 19 / 88%
 

Sam Granger is on a distinguished road

Send a message via MSN to Sam Granger

  Old

Originally Posted by mikeroq View Post
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
Kirth is offline Kirth
Status: I'm new around here
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 23
iTrader: 0 / 0%
 

Kirth is on a distinguished road

  Old

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
localhost is offline localhost
localhost's Avatar
Status: Dediport Hosting
Join date: Jul 2006
Location: Berkshire
Expertise: programming, business
Software: Dreamweaver
 
Posts: 1,316
iTrader: 17 / 100%
 

localhost is on a distinguished road

  Old

I trhink window.location.href is better..

02-17-2007, 11:17 PM
#9
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

PHP Code:
echo"<META HTTP-EQUIV=\"Refresh\"
      CONTENT=\"0; URL=location.html\">"

02-17-2007, 11:27 PM
#10
MaxS is offline MaxS
Status: Senior Member
Join date: Aug 2005
Location: New York
Expertise:
Software:
 
Posts: 825
iTrader: 1 / 100%
 

MaxS is on a distinguished road

  Old

Originally Posted by Village Idiot View Post
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">'

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed