What is the best way to customize Joomla urls? - joomla

I have a big joomla site and I want to customize its links to be as SEF as possible. I need an alias for each individual article and custom component item. Is it better to use the router.php class in each component or to assign a hidden menu item for each one from the perspective of the load on the server and the clean xml generated sitemaps?
Thanks in advance

As i understand your question i would like to suggest you to use sh404SEF. It rewrites Joomla URL to user-friendly format (SEF URL or URL rewriting):
For Example:
mysite.com/index.php?option=com_content&Itemid=69&id=34... becomes
mysite.com/en/sh404SEF-and-url-rewriting/list-of-available-plugins.html.
It is also a security component. Page title and meta tags manager for every page. With or without .htaccess file. Joomfish compatible. Caching system for high speed and very small DB queries overhead.
Or as you say you can also use router.php class in each of your component to make sef url. Hope this will help you.

Related

Magento translation and url key

I have a Magento website with some pages linked to main navigation.
For example, in my default view (Italian) I have www.example.com/italian-url-key
Then I created another page for English view with url www.example.com/english-url-key
So, when I am on the italian version of the page and try to switch to english version, this is the url that magento generate: http://www.example.com/italian-url-key/?___store=english&store=&___from_store=default and on click it gives me 404 page.
How can I fix it? I need that this 2 pages should be linked, also if url key is different.
Many thanks!
Out of the box Magento does not support URL Translation, both pages need the same URL key. Check instructions from the Magento Docs on how to translate CMS pages.
To translate a CMS page, you must create a new page that has the same
URL Key as the original, but assigned to the specific store view.
So you will either have to stick to one languages for your URLs or develop/acquire a module to do this for you. The magento-language-roots or CMSRewrites modules both look like they will achieve this for you.
You may also want to consider adding Hreflang tags to your head.phtml as you have a multi-lingual site.

Change Joomla 3 page url extension from .html to .htm

I am creating a website using Joomla 3 CMS. I have a requirement from my client that i need to change the existing page url extension from .html to .htm. As this website is redesign of a existing website the old links have .htm extension.
Open ../libraries/cms/router/site.php
Go to line number 144
And change
if ($format = $uri->getVar('format', 'html'))
to
if ($format = $uri->getVar('format', 'htm'))
I hope that helps
If you don't want to edit core files, and that is certainly not advised for sake of future upgrades. Your best solution is using a custom component for managing Joomla's SEF URLs, for example: sh404SEF (Paid) or JoomSEF (Free).
Check out http://extensions.joomla.org/category/site-management/sef for others.
Never ever edit Joomla Core files, otherwise when you upgrade Joomla, all your changes will be gone.
As #Alexxandar said; use SEO/SEF components for your needs. I recommend to use MijoSEF (Free or Paid)
Go to global configuration and remove the l from the suffix.
THis is a Joomla configuration question and a standard joomla configuration (not programming) option.
Now the one thing you will have to worry about is that if there are any old links to the htm pages. FOr this you will probably want to use the built in redirect component. Turn on the redirect plugin and then if you have a small number of pages you can just set up the redirection by hand. If you have more pages you may want to write the sql to create a bunch of redirects. Or you might want to make your own plugin to permanently redirect the old to the new.

Add static javascript to every page of joomla

Im completely new to Joomla development. I need to develop Joomla plugin that adds static javascript to the footer of all the pages of a Joomla site. Also, the plugin would need to save 2 fields in database, and access these fields on per page basis. Also, Admin panel is needed.
Now, my questoion is, where do i start? Joomla plugin development is a big task, so if I can get some pointers as to where to start, it would be very supporting.
Im not asking for direct code, but just the right direction to start.
Thanx in advance....
Joomla has three types of extensions (what you refered to as plugin): components, modules and plugins, where each has a different purpose.
If you need to add javascript to all pages, the best place is your template. If you don't have access to template, just building an extension, then you have to create a content plugin.
If you need to create extension with admin panel which also works with database, you need to create a component. The best place to get started is tutorial Developing a MVC component for Joomla 2.5

joomla rename component url using htaccess

I'm building an eshop using Joomla 2.5 and a commercial component for a guy who wants to have multiple vendros and I'm stuck on how to change the component's url.
What I want to change is the url that is displayed when the users passes from a link with his mouse.
For instance, the component has a SEF function which rewrites urls and makes them like that:
http://www.site.com/componentname/products/productname-productid-productcategoryid-vendorid.html
http://www.site.com/componentname/catalog/categoryname-categoryid-numberofpage.html
and what I want is to make it:
http://www.site.com/shop/products/productname-productid-productcategoryid-vendorid.html
http://www.site.com/shop/catalog/categoryname-categoryid-numberofpage.html
So when a user passes over a link it will show him the new url. Is this possible with .htaccess and rewrite rules or this can only be done through the component only? I'm asking this as the component is encoded with ioncube so I can't do it myself.
Thanks in advance!
While you can use .htaccess to rewrite any URL it won't work with Joomla! as the SEF URL is created by JRoute which uses a combination of the core route function and the route.php for the component.
The URL segments are used to find the right component to handle the request, so to change the way the URL is built you would have to modify the route.php of the component (and obviously other parts as well).
For more information on how SEF support works, read this on docs.joomla.org

Custom short URLs in Joomla 1.5

I had a long ugly long URLs for Joomla articles. Being advised here to enable SEF, I got:
www.domain.com/cat1/subcat1/120-results-of-DES-project-in-2011
Nicer, but I also want custom short URL for specified article, like:
www.domain.com/des
Is this possible in Joomla 1.5? Simply adding rule to .htaccess is possible but not what I'd like, because:
I'd prefer that the short URL remains in the Location bar after the page is loaded
Joomla to use that short URL whenever the articles is clicked from news etc.
(P.S.: if it's not possible, then I'd be happy with some simple URL "aliaser" for Joomla, which would work similarly to .htaccess, but preferably with short URL remaining in the browsers' location bar.)
As Trev mentioned you need to turn on SEF URLs. In the admin, in the Site menu click on Global Configuration. In the Site configuration you should see a box for SEO settings. Turn on all 3 options unless you don't want the .html suffix, that one can be left off.
Now Joomla will create URLs like this -
www.yourdomain.com/parent-menu-alias/child-menu-alias/article-alias.html
If the menu item is linking directly to an article, then it would be -
www.yourdomain.com/menu-alias.html
Have you enabled SEF and htaccess in the Global Configuration? If you do then the URLs to any articles is controlled by the article's alias. e.g. if you want an article to be
http://mysite.com/my-url just open the article in the article manager and change the Alias field to my-url

Resources