drupal 7: showing main menu links to anonymous users
First you need to install the Chaos tool suite (ctools) module, and enable the Page Manager module, and go to admin/structure/pages

Then we need to wrap whatever we are linking to in a Page, handled by the Page Manager. Exactly how we do that will differ a little bit depending on what we are linking to. The page manager contains many options, and I cannot describe all of them in detail here. You may want to watch this video introduction if you have never seen page manager or panels before. Videos 1 to 3 together are less than 30 minutes, and are likely necessary to make sense of the instructions below.

For nodes: Enable the node template.

For Views: Click "Add custom page", add the View in that page instead, and save.

For Module defined pages: Use Page manager existing pages to hand them over to the page manager.

For Something else entirely: Comment on the answer and tell me what it is, and I'll add instructions.

Now, in the Page manager interface for the page you enabled/created above do the following


Create a variant of type "HTTP response code".
Set the response code to 301.
Set the path to /user
Go to "Selection rules" in the left menu
Add "User:role" == "anonymous user"
Save