Normally, you control which modules display on a page by assigning modules to a menu item. However, in some cases you may not have a menu item that corresponds to each page of your website.
Linking From One Article to Another
One case where this is true is when you are linking to articles from another article. For example, you may have articles in your site that will not have specific menu items associated with them. Instead, you may be linking to these articles from other articles. In this case, you will not have a way to assign modules to individual articles.
You can still control which modules display on which articles by manually setting the Itemid portion of the link URL. Say, for example, that you will have five different "page types" that will display, depending on the article. Each "page type" will have its own combination of displayed modules. Here is how you can set this up:
index.php?option=com_content&view=article&id=xx&Itemid=yy, where xx is the ID of the desired article (from the Article Manager) and yy is the ID of the desired menu item "page type" (from the Menu Item Manager).
When these links are displayed, the modules assigned to the Menu Item corresponding to the Itemid=yy will display along with the Article corresponding to the id=xx. Note that you can still use the Joomla SEF URL option. In this case, the URL will be converted to the SEF format, but the correct Itemid will still be used.
sh404SEF is also able to be used to add the &Itemid=yy to the non-SEF URL. Simply allow sh404SEF to create all the URL's for the articles that have no menu item link, then go in and copy the non-SEF URL, delete the sh404SEF created URL, and create a new SEF URL with the $Itemid=yy added and the same SEF URL.
Linking to an Article from a Module
The example above assumes that you have control over the URL used for the link. However, in some cases, the link is created automatically for you and therefore you don't have the option of manually changing the Itemid of the URL. Examples of this include the Latest News and Most Popular modules, both of which give you links to articles automatically. In this situation, you can still control which modules display when you link to an article. Here are three possible approaches.
Controlling Module Display With an Extension
Another approach to the problem is to display modules using an extension that provides detailed control over where a module displays. One such extension is Mod OnAnyPage.