Why is Joomla 1.5 creating different URLs for the same articles on different pages? - joomla

I'm trying to understand the way Joomla (1.5) creates article URLs.
I created a module to display news. The module displays all the news, with correct URLs on the homepage mysite/component/content/article/xxxxxxxx.
I created a module to display the last article on the homepage and a button, see all news, linking to a menu item displaying a page with all the articles. The url is: mysite/news.
The problem is the URLs to the article are generated incorrectly as mysite/news/xxxxxxxx and they give a 404. How can I get the URLs to be the same as on the homepage?
Update: The new URL doesn't give a 404, it points to the same page as the menu, I mean mysite/news/ is the same as mysite/news/xxxxxxxx, it shows the list of all the articles and not the article itself

To create proper SEF URLs, two steps are needed:
Be sure to have a menu entry for each article in the list. You don't have to display that menu, it just has to exist. The menu entry's alias is used to build the SEF URL.
When creating links to such an article, be sure to include the parameter Itemid=n in the URL, with n being the id of the menu item. In article texts, use this structure:
index.php?option=com_content&view=article&id=23&Itemid=125
Joomla! will convert that into a SEF URL automatically, and it will still work, when you for some reason turn SEF off.
If you generate links in a module, the URL is not converted automatically. You have to call JRoute::_() for that:
echo JRoute::_('index.php?option=com_content&view=article&id=23&Itemid=125');

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.

Joomla! what is the link to the new page I just created?

I have been tasked with updating a Joomla site. I have been working with existing pages for a while, but now I had to create a new page.
I just created a new page using Joomla. But I can't find what the URL to that page is. Also, the pretty urls are enabled. But I don't know how to create a pretty url for the page I just created.
I even tried adding the id to /index.php?Itemid= in the url and doesn't work.
Seems like something like this would be self-explanatory, but I have been looking around in the options and the menus and googling for the answer and I can't find it anywhere.
As far as I know, you need to attach an article to a category to view it.
You can assign the article to a category. After that open an article from that category and replace the text after the last "/" in url with the alias of your article.
You can also assign the article to a category that is linked to a menu item. that way you will be able to see the article link in the menu.
You may later remove the article from the category.

Joomla .htm url mapping to pages in CMS

I inherited a Joomla site that has a set up I'm not familiar with. The url of pages on the site are like
http://hufboxing.com/about.htm
http://hufboxing.com/training.htm
http://hufboxing.com/schedule.htm
I looked in the .htaccess file and do not see any rules that map .htm urls to the Joomla query string urls.
In the CMs, on each article are url alias. The corresponding URL alias to each of the urls above are:
http://hufboxing.com/about-us
http://hufboxing.com/team-training
http://hufboxing.com/the-gym-schedule
However, going to any of these alias gives a 404 page. Even if I attach a .htm extension to these urls, it gives 404 page.
Where do I go in Joomla to add new pages to the site and add new .htm urls?
Here is the website:
http://www.hufboxing.com
That is normal. They are based on your article and menu aliases. Joomla uses a database to store the text so you won't find pages. How do you want the urls to look? Also what version? To add pages login to administrator and go to create article. Then you may want to go to the menu manager and link. I recommend you review the beginner docs at http://docs.joomla.org.

Joomla: homepage url

Joomla requires that home page was linked with some component.
So, if i link menu item of homepage to some article, i get a url like:
"index.php?option=com_content&view=article&id=68&Itemid=464" on frontend.
How to link homepage to "/" ?
UPD:
Joomla verion 1.7
Maybe, i not accurately explained.
I link home menu item with some article.
When i go to www.mysite.com - all fine, choosen article is shown on homepage.
But then the home menu item on frontend became "index.php?option=com_content&view=article&id=68&Itemid=464", not just '/'
You must use the default Joomla format for setting something as the "home" page. in 2.5 (since you failed to tell us which version you're running) you do this by using 'featured articles'. By default, any featured article is displayed on the homepage.
In older versions (1.5) you must mark it to display on the 'front page'
In doing that when you go to http://www.yoursite.com/ - you will see the articles listed as 'featured' or 'front page' articles. You can adjust how they display by using the front page or featured article manager.
I apologize if I've misunderstood your question - but hope this helps. It also looks like you don't have SEF URL's turned on - you may want to look into that. Regardless your front page will display without any additional URL stuff if you use the methods outlined above.
In your menu manager (backend), create a new entry for 1 article and select it in the list. After that, just define this new menu entry as default (or homepage).
This article will be the default homepage of your website and will be accessible via www.yoursite.com/

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