How to get domain (without path)

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
Provacc
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Mon Jan 12, 2009 1:07 am

How to get domain (without path)

Post by Provacc » Sat Sep 18, 2010 6:35 am

I have my Joomla installed in http://www.domain.com/joomla/

How do I get 'http://www.domain.com/' (without paths)?

I'm trying to pass a URL into a JRoute like this:

Code: Select all

JRoute::_("index.php?option=com_crowdsource&view=messageboard&cat=$permacat&title=$permatitle&cid=$c_id&Itemid=124");
This code produces "/joomla/rest-of-SEF-URL/..."

I need to get my full domain (including http://...) and every other JURI type of function I can find to add to the beginning also includes '/joomla/' which creates:
http://domain.com/joomla/joomla/rest-of-SEF-URL/...

Can someone please tell me what function is available to add just my domain (scheme) to my JRoute?

Thanks,
-David
(already read this and this.

User avatar
ursitesion
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Tue Aug 10, 2010 12:52 pm
Location: Delhi, India
Contact:

Re: How to get domain (without path)

Post by ursitesion » Sat Sep 18, 2010 7:04 am

Hi David,
You can use,
dirname(juri::base()) to get the domain name without path.
If I m not write,
Can you write here your input and expected output URL what do you exactly want?

Thanks,
ursitesion

BeyondWEB
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Aug 06, 2012 3:34 pm

Re: How to get domain (without path)

Post by BeyondWEB » Sun Aug 26, 2012 2:01 pm

You're looking for:

JRoute::_('index.php?bla=bla...', true, -1);


Locked

Return to “Joomla! 1.5 Coding”