Hot answers tagged

6 votes
Accepted

Create a link from Backend to SEF Path in Frontend

Since 3.9 there's Joomla\CMS\Router\Route::link() method which takes client (site or administrator) as first argument. $link = 'index.php?option=com_content&view=article&id=1'; echo '<a ...
Sharky's user avatar
  • 10.5k
5 votes
Accepted

How do i remove the id from Joomla 3 URLs using code

Good question. It looks likely that the new Joomla router held over until Joomla 3.6 will fix this issue. In the meantime, there is a $15 extension, SEF Wizard for Joomla that, "removes IDs from the ...
Neil Robertson's user avatar
4 votes

How to configurate Joomla or Apache for v1 SEF Urls?

I managed to piece together a solution without using .htaccess, though I'm interested in a cleaner solution if somebody has one. I created a system plugin that really does nothing in the conventional ...
GDP's user avatar
  • 7,705
3 votes
Accepted

Supporting SEF URLs in custom component

In the old days, the router.php file contained functions: BuildRoute and ParseRoute. Nowadays, if you look at the router.php of the banners extension for example, you will see a class called ...
itoctopus's user avatar
  • 3,216
2 votes

SH404SEF : How to redirect a URL to home?

sh404SEF developer here The answer by FFrewin above is not correct. To redirect some URLs to home page, you simply: Click on the "Home page meta" toolbar button on any page of sh404SEF control panel ...
Weeblr's user avatar
  • 51
2 votes
Accepted

SH404SEF : How to redirect a URL to home?

It's a bit tricky to do this redirection in SH404SEF. Here is the practical steps to achieve that: In SH404SEF URL Manager, find the SEF urls of the page that you want to redirect to homepage. ...
FFrewin's user avatar
  • 19.6k
2 votes
Accepted

How to remove IDs from SEF URL in Joomla?

I found the solution with the help of @Farahmand, here it is: <?php defined('_JEXEC') or die; function empresaBuildRoute(&$query) //Esta función divide la url y se trae las variables. { $...
Ignacio Salcedo's user avatar
2 votes

How to modify a SEF URL including an arbitrary text

Check Language Filter system plugin, you'll see how they manipulate the url to add language prefix to links. You could use the same method to add location prefix based on cookie value. Here is what I ...
Marko D's user avatar
  • 471
2 votes

Why Joomla 3 add Canonical tag to current page and made it unindexable?

The solution that worked for me is the same as Robert Went has on his blog. Here it his: $doc = JFactory::getDocument(); foreach($doc->_links as $k => $array){ if($array['relation'] == '...
miguelmpn's user avatar
  • 303
2 votes

How to change URL's for each page in joomla 3.4?

Joomla SEF URLs - the background I will try to give briefly some background info. The common way for displaying content/pages in Joomla, is to create it inside Components.. Components provide menu ...
FFrewin's user avatar
  • 19.6k
2 votes
Accepted

One link to point a multilanguage article

Joomla router just doesn't work that way. Only way you could have a link /article-for-all is to create a menu for each article and to manualy set that alias in both menu items, because Search ...
Mikan's user avatar
  • 3,007
2 votes
Accepted

Redirecting to component when using SEF

The correct way to do that and to accomplish more complicated tasks is to add a router file in /components/com_rouf/router.php with a class that will manage your custom routing. Take a look at the ...
Kitase88's user avatar
  • 977
2 votes
Accepted

How can I make all pages urls of my joomla 3 web site have the .html extension?

Here is how to show it: For adding the document extension type in your URLs, you need to go in: -> Global Configuration -> Site -> enable the "Add Suffix to URL" setting, at the SEO Settings ...
FFrewin's user avatar
  • 19.6k
2 votes
Accepted

Absolute SEF url with JRoute

You could try this way: $itemid = 164; $application = JFactory::getApplication(); $menu = $application->getMenu(); $item = $menu->getItem( $itemid ); $link = new JURI( $item->link ); $link-&...
FFrewin's user avatar
  • 19.6k
2 votes

Using SEF URLs breaks all templates

I found the problem: The templates were not at all responsible. I am using the JCH Optimize plugin. In the Basic Options tab, there is a Use url rewrite parameter. That was the problem. When I ...
Leonardo Pinheiro's user avatar
2 votes

How does Joomla! URL Re-writing works?

The following are sequence of steps occur when you invoke a url: Joomla will split the url into parts separated by "/", each part (apart form website name itself) is alias of a menu item, an article ...
Nagarjun's user avatar
  • 2,991
2 votes

Is it safe to use `Use URL Rewriting` option?

When SEF is enabled on a Joomla website, the old non-sef urls still work normally so search engines will still be able to find the pages whether they use the SEF or non-SEF url. These days, Google ...
Neil Robertson's user avatar
2 votes

Article appears even outside given path

This is a problem with the Joomla content router. Specifically, in the following code: if (!$advanced) { $cat_id = (int) $segments[0]; $article_id = (int) $segments[$count - 1]; if ($...
itoctopus's user avatar
  • 3,216
2 votes
Accepted

Joomla 2.5.6 infinite 303 loop (SEF)

The problem is likely your HTTPS redirect. You are likely redirecting to HTTPS at the beginning of your .htaccess file, and later redirecting to HTTP. Another scenario is when your Joomla website is ...
itoctopus's user avatar
  • 3,216
2 votes
Accepted

Menu links working only for logged in users

It's probably best to run a backup before making any changes. SEF To narrow down the problem, try disabling URL Rewriting and SEF and renaming .htaccess to .htaccess.old. If this helps, try re-...
Neil Robertson's user avatar
2 votes
Accepted

How to disable Joomla routing by Article ID with any alias but use exact alias only

May not be practical for blog articles, but a fixed url can be achieved via menu items: https://docs.joomla.org/Search_Engine_Friendly_URLs#Limitations Otherwise, if I see it correctly, you have to ...
astridx's user avatar
  • 404
2 votes

Update SEF URL to change what is output

Joomla works with internal (for example /index.php?option=com_content&view=article&id=42) and external SEF URLs (/some-name). The SEF URLs are created via the menu, and the "alias" ...
pe7er's user avatar
  • 1,918
2 votes

J4 component URL not SEF

Solution found, all details on https://forum.joomla.org/viewtopic.php?f=831&t=996848 To create a routing in J4 with same behavior that J3, you need to create 4x files : /com_componentname/src/...
Yann's user avatar
  • 41
1 vote

How to change SEF urls to remove item view from url?

Take a look into the com_content router, category blog view works like that, shows a list of articles under domain.com/blog and the links are generated like domain.com/category/1-my-first-article But ...
Dennis Heiden's user avatar
1 vote

How do i remove the id from Joomla 3 URLs using code

I use Direct Alias Pro. It's $24, works like a charm and is lightweight without all the other random features. https://alterbrains.com/joomla-extensions/seo/direct-alias-pro
YellowWebMonkey's user avatar
1 vote

Canonical issues- incorrect URL shown on home page

Add this to your templates index.php file before the closing body tag: $JInput = JFactory::getApplication()->input; $itemid = $JInput->get('Itemid','','int'); if($itemid == 'YOUR NUMERIC HOME ...
Terry Carter's user avatar
  • 1,787
1 vote

SEF urls without article ID causes 404 article not found error

I would say (even though you're saying that you already checked that), that the problem is caused by duplicate aliases. I recommend you check that the alias does not exist twice in the #__content ...
itoctopus's user avatar
  • 3,216
1 vote

SEF urls without article ID causes 404 article not found error

Yes it's possible to get urls without IDs by rewriting the router.php, but I don't recommend to change core files or core components like the com_content for future compatibility. You should use a ...
Dennis Heiden's user avatar
1 vote

SEF urls without article ID causes 404 article not found error

Well, I believe you've faced my issue. You can take a look here - you'll find why it's happening and how to quick fix it. https://github.com/joomla/joomla-cms/pull/10261
Alexandr's user avatar
  • 1,130
1 vote

.htaccess and localhost issue

An .htaccess file from a live environment may contain many directives that cannot work in another environment, especially a localhost environment. In your case, I would guess to look for the # ...
FFrewin's user avatar
  • 19.6k

Only top scored, non community-wiki answers of a minimum length are eligible