Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Point user back to Frontpage if they reach a certain page

Point user back to Frontpage if they reach a certain page

Hey Stephen,

I want to send my users back to the frontpage after they register or login instead of to the Virtuemart Thank you note.  I have used the recipe to determine the page variables for the thank you note so I can identify that part, but I am not sure how to send them back to the front page.  I can't use the recipe for redirecting to a particular page because this is a Master site that will be used to generate slave sites and so I can't hardcode the url.  Any suggestions???  (something like <a href="index.php?Itemid=272"> is what I need to direct them to.) 

Thanks!!!

Sondra

slboone
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Point user back to Frontpage if they reach a certain page

Ok, I think I see what you are asking: you're saying that you don't know for sure what domain name they are using, so it's hard to make an absolute URL for the redirection.

Well, you can get hold of the current hostname (that was used in the current request) quite easily, so it's really not a problem.

Try this:

if (blablabla){ // ... your rule here
  $app = &JFactory::getApplication();
  $app->redirect( 'http://' . $_SERVER['HTTP_HOST'] . JRoute::_('index.php?Itemid=272' ) );
}



Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Point user back to Frontpage if they reach a certain page

As always, you are the best!!!!!

slboone
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Point user back to Frontpage if they reach a certain page

As always, you are the best!!!!!

slboone
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
121

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked