Actions

Difference between revisions of "Putting default 'Home Page' at any position in mainmenu"

From Joomla! Documentation

(Allow request for example.com/ with only trailing slash to also work.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
By default in Joomla! 1.0.x the first page in mainmanu is also the default home page for your site. You can't put front page on some other position in menu and set it up as your home page, at least you can't do it using administrator interface.
+
{{JVer|1.0}}
  
But you can do some little modification in .htaccess file to achieve similar effect..
+
By default in Joomla! 1.0.x the first page in the Main Menu (mainmenu) is also the default home page for your site. You can't put the front page in some other position in the menu and set it up as your home page, at least you can't do it without resorting to tricks.
  
First you create link in the main menu to your front page and put it on place where you want ... it doesn't need to be first place in your main menu.
+
== Using .htaccess ==
  
then add this lines at the end of your .htaccess file:
+
You can make a little modification in .htaccess file to achieve a similar effect.
 +
 
 +
* First create a link to your front page in the main menu and put it in any place where you want ... it doesn't need to be first in your main menu.
 +
* Add these lines at the end of your .htaccess file:
  
 
<source lang="apache">
 
<source lang="apache">
 
RewriteCond %{REQUEST_METHOD} GET
 
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^index.php$ index.php?option=com_frontpage&Itemid=1   [QSA,L]
+
RewriteRule ^(index\.php)?$ /index.php?option=com_frontpage&Itemid=1 [QSA,L]
 
</source>
 
</source>
  
 +
''You might want to change the <code>Itemid=1</code> to the Itemid of the link you created.''
 +
 +
== Using a hidden Main Menu ==
  
 
''I'm not saying the above couldn't work but it seems problematic.''
 
''I'm not saying the above couldn't work but it seems problematic.''
  
 
The best way to get flexibility about the location of your "home page" in your visible navigation is to put Main Menu into a position that is not visible to your users. Then make a separate primary navigation menu with whatever links you want in whatever order you want them.
 
The best way to get flexibility about the location of your "home page" in your visible navigation is to put Main Menu into a position that is not visible to your users. Then make a separate primary navigation menu with whatever links you want in whatever order you want them.
 
  
 
[[Category:Tips and tricks]]
 
[[Category:Tips and tricks]]
 
[[Category:Tips and tricks 1.0]]
 
[[Category:Tips and tricks 1.0]]

Latest revision as of 07:01, 7 May 2011

Joomla 1.0

By default in Joomla! 1.0.x the first page in the Main Menu (mainmenu) is also the default home page for your site. You can't put the front page in some other position in the menu and set it up as your home page, at least you can't do it without resorting to tricks.

Using .htaccess

You can make a little modification in .htaccess file to achieve a similar effect.

  • First create a link to your front page in the main menu and put it in any place where you want ... it doesn't need to be first in your main menu.
  • Add these lines at the end of your .htaccess file:
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^(index\.php)?$ /index.php?option=com_frontpage&Itemid=1 [QSA,L]

You might want to change the Itemid=1 to the Itemid of the link you created.

Using a hidden Main Menu

I'm not saying the above couldn't work but it seems problematic.

The best way to get flexibility about the location of your "home page" in your visible navigation is to put Main Menu into a position that is not visible to your users. Then make a separate primary navigation menu with whatever links you want in whatever order you want them.