Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Cerbalus-aravensis-spider-photo-3 Task

Get original Joomla URL from a SEF one. I.e. I want to know which is the real joomla URL, while the SEF one is http://sandbox2.com.us/index.php/weblinks-component

This may be needed while developing or making modifications in Joomla extension to use the real internal joomla link.

Solution for Joomla 3

The code below alswo works in most cases, but at least once I've met a strange behaviour - url parts were messed up with some Google Analytics variable. So I gave up using it

Result in $url: index.php?Itemid=229&option=com_contact&view=contact&id=1

Old solution for Joomla 1.5, doesn't work with Joomla 3

         // Here I "unparse" the Joomla SEF url to get the internal joomla URL
            JURI::current();// It's very strange, but without this line at least Joomla 3 fails to fulfill the task
            $router =& JSite::getRouter();// get router
            $query = $router->parse(JURI::getInstance()); // Get the real joomla query as an array - parse current joomla link
            $url = 'index.php?'.JURI::getInstance()->buildQuery($query);

Thanks to Gruber

Comments   

Guest
+2 # Guest 2013-02-28 00:02
Thank you!!! I've been searching for the past hour for that.

Please register to post comments.

Found a typo? Please select it and press Ctrl + Enter.
FaLang translation system by Faboba
Електронна бібліотека «Exlibris»: історичні дослідження, мемуаристика, публіцистика, художня література Українська етнографія: книги, курси лекцій, статті й матеріали, мапи, фотоальбоми, веб-ресурси Правителі України: портрети, життєписи, матеріали Твори Адріана Кащенка: романтика козацьких часів Народна війна 1917-1932

See a typo?

Select the text block and press

CTRL+Enter

Comments

  • NotificationAry - get emails on Joomla content is submitted, added or changed

    shteevy shteevy 23.02.2019 01:13
    Hello, not easy for me to give you an akeeba because our Joomla in an Intranet with many things from ...

    Read more...

     
  • NotificationAry - get emails on Joomla content is submitted, added or changed

    gruz gruz 22.02.2019 09:49
    Sounds like a bug. To test/fix the issue I need your web-site copy (akeebabackup of your Joomla or a ...

    Read more...

     
  • NotificationAry - get emails on Joomla content is submitted, added or changed

    shteevy shteevy 21.02.2019 19:02
    Hello, many thanks for this extension !! :-) Could you please explain me how to get the "notify switch" ...

    Read more...

     
  • MVC Override - change joomla extensions behaviour without changing core files

    gruz gruz 25.01.2019 16:03
    No. It's PHP log files generated at a level higher then Joomla.

    Read more...

     
  • MVC Override - change joomla extensions behaviour without changing core files

    mboquillon mboquillon 25.01.2019 15:59
    In the administrator/logs folder ?

    Read more...