Joomla - Restricting Access to a Menu Item without making its Items unaccessable - joomla

How should I deny access to a menu item, but still keep its items accessable? For example, I want to deny access to www.mysite.com/dir/ , but have the www.mysite.com/dir/page.html accessable.

In the Joomla backend, open the selected menu item you wish to change in the Menu Manager, then on the left hand side, you can set the permissions to either Registered or Special

I found a solution in this post, and it is to redirect the menu item link using htaccess. Consider to perform both of the below redirections.
Redirect ^/dir.html$ http://mysite.com/
RedirectMatch ^/dir$ http://mysite.com/

Related

Joomla 2.5 redirect to requested page after login

In joomla 2.5 user's are taken to predefined page after they have logged-in.
But i need to redirect users to the previous page after they have logged-in, i have tried to search for it every where but i am unable find proper solution explaining what core file i need to modify ?
All you need is an article with a little piece of javascript to browse the history of the user and call the page before the login form. Redirect the user on it on log in.
If you have a menue item (User/Login Form), there is, on the right hand side of the screen, a tab called Basic Options. The first field is called "Login Redirect". Put the article's URL there.
If you use the module: Again in the tab "Basic Options", you can redirect to Any menue item you want, so set a menue item (it has not to be actually showing up somewher) for the article

make my site url user friendly using router.php

I am working on SEF - router.php to make my site url user friendly.
This is my url and I want to remove the name 'component' and 'com_test' from this url.
http://localhost/projects/component/com_test/project/1-unique.html
I have checked with unset($query['view']) but it doesn't make any changes on the site.
Note : Please dont got for creating menu item for aliases.
You need menu items for that. otherwise you will get exactly these URLs. There is no way to avoid the /component/com_test/ part as Joomla is not able to guess what you want to do. The part behind that (/project/1-unqiue) is up to the router.php of your component.
If you don't want to have a menu item visible on your site, you can also create hidden menu items just for SEF purposes. You create a new menu with those menu items in it, but don't assign it to a module or just don't show the assigned module on any page.

Missing Itemid on url at login pages

I'm on Joomla 2.5.
I created a menu item named "Login Form" with Itemid=626 . Also I created a menu item named "Article" with access level "Registered".
The Problem
When a user click on the "Article" menu item on the frontend, he goes to login page index.php?option=com_users&view=login I need this url to contain Itemid=626 so it could be index.php?option=com_users&view=login&Itemid=626
Please advise
I think you can't override standard joomla login page just creating a menu item.
To create easily some rules and redirect the users you can use this component, Chameleon.
If you don't need complex rules you can just auto redirect all users from standard login to your page.

Joomla front page manager not working

I have 3 articles in the front page manager. However, when I change the order of these articles in the front page manager, it does not change on the actual front page of the site. What am i missing?
You need to set the menu item sort order method. Go in to your front page menu item, click on Parameters (Advanced) then select the primary order method you would like to use. By default it does it by article ID, you need to change it to order.

URL rewriting in joomla

I need to rewrite url in joomla. But the url should not be showing "index.php" and no numbers (0-9) as well.
1st condition:
The url cannot be " http://www.abc.com/index.php/components/article" rather than it should be "http://www.abc.com/components/article".
2nd condition:
the url cannot be "http://www.abc.com/components/article/9" where it contains 9 number .
How can this be done?
Joomla comes with htaccess.txt, and the option to rewrite urls. So you have to first change the htaccess.txt file to .htaccess on the server, then login and in the configuration settings change SEF to on, and use .htaccess to on.
In support of the answers from gnomeontherun and Hennie. You have some control over how the url is made up by joomla, through the menu structure and the alias for the each menu.
Sometimes it's worth creating menu items even if you don't show them on a menu on your site.
e.g.
Menu structure:
Home
-Latest News *(Could be a category blog view)*
--News article 1 *(Link to article but this level need not be shown on menu)*
--News article 2 *(Link to article but this level need not be shown on menu)*
url should look like:
/latest-news *(for the blog view)*
/latest-news/news-article-1 *(for the article view)*
If there is no menu item which relates to an article, Joomla makes up the url itself using category+id/article-alias+id etc. If it does find a menu item, it will use the structure of the menu instead.
Joomla uses the alias of the menus for the actual content:
i.e. menu-alias-level1/menu-alias-level2/news-article-1
Using this method from the beginning will allow you to keep your urls consistent whether they are accessed through the blog page route or directly. This will help with your SEO.
Of course it can be a pain to create a menu item for every article but I know some Joomla guys who swear by it and will do it even for thousands of pages...
for the index part ...
Perhaps this will work for you too
RewriteRule ^index\.php$ http://www.yourdomain.com/ [R=301,L]
or
Redirect 301 /index.php http://www.yourdomain.com
To get rid of the 'index.php':
Rename the htaccess.txt file to .htaccess
In the backend, turn on SEF URLs and URL rewrite
Joomla will then show your article using something like "http://www.example.com/category/article/9", unless you assign a menu item to that article. There is no need to show that menu, so you can create new menu, call it 'hidden' (or any other valid name) and do not publish the module.
A more comfortable option is to use one of the many SEF components, which make it much easier to manage the URLs. Most if them additionally provide meta data control.

Resources