unable to set homepage to user/[account:uid] OR /user/%user.

i am trying to set the home page to go to the users profile. Any suggestions?
On a profile view, The URL appears as http://sitename.com/users/username

thanks,
chris

Comments

dublin drupaller’s picture

Assigned: Unassigned » dublin drupaller

quick fix..use a php snippet in your front page home settings that uses drupal_goto to redirect to the users home page.

e.g. (this is untested..just a general idea)

global $user;
$redirect = "/user/". $user-uid;
drupal_goto ($redirect);

hope that makes sense..that syntax probably isn't right...am a bit rushed at the moment, but, if you know a little drupal php, it should be easy enough to do. search api.drupal.org for the drupal_goto syntax.

dub

glitz’s picture

dont know to much php but i will give it a shot.

THANKS!

timhilliard’s picture

Status: Active » Needs work

Hi glitz,

the easiest way to achieve this is to set the path to "user". This will show the log in page for anon users and the currently logged in users profile page for authenticated users. Therefore if you set "user" to any role other than anon it will show the logged in users profile page.

I am however going to leave this thread open as I like the idea of variable substitution and may well include that in the 2.x version of front page.

Cheers,
Tim

glitz’s picture

great, thanks!! ill try this out and reply back.

-glitz

glitz’s picture

works perfect. thank you

timhilliard’s picture

Status: Needs work » Closed (fixed)

Glad to hear it!