Keyword

Absolute URL

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 4 months ago #143920 by Joe Campbell
Absolute URL was created by Joe Campbell
What is the difference between using K2 absoluteURL vs. JURI current to produce the current page Absolute URL?

<?php echo $this->item->absoluteURL; ?>
<?php echo JURI::current(); ?>

I tried both and realized that the K2 absoluteURL method rendered the URL with a missing slash between .com & category (.comcategory)
Is it because I configured my .htaccess file to remove trailing slashes?

## Remove trailing slash
RedirectMatch 301 ^(.+)/$ $1

Can echo K2 absoluteURL be used for categories, tags, user pages? If so - how?

Will either effect my ability to use urlencode?

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #143957 by Lefteris
Replied by Lefteris on topic Absolute URL
Hi,

As far as i remember JURI::current does not include the query part ( if any ) of the URL.

The variable absoluteURL is build directly from the core API:
$uri = JURI::getInstance();
$item->absoluteURL = $uri->toString();
If it's not working for you, then probably something is wrong in your configuration.

Finally, regarding the Nginx setup you might want to take a look at those resources:

docs.joomla.org/Nginx
docs.joomla.org/Enabling_Search_Engine_Friendly_%28SEF%29_URLs_on_Nginx

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 4 months ago #143960 by Joe Campbell
Replied by Joe Campbell on topic Absolute URL
Thank You @Lefteris

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum