I was not aware that you were using Front Man (or any other framework). I am not familiar with Front Man beyond knowing it is a Web App front Controller. As such, my previous comments may not apply since Front Man may provide functionality to do what you are attempting to accomplish.
Also, can you indicate what your goal is. My initial understanding of your question was that you wanted it so that if someone navigated to a single resource, namely www.mysite.com and only www.mysite.com, that they would be redirected (not forwarded) to www.mysite.com/command/index. The suggestion I made would only work for people navigating to www.mysite.com. If they navigated to www.mysite.com/page1.html they would
not be redirected to www.mysite.com/command/index nor to www.mysite.com/command/index/page1.html. Also, I suggested a redirect, not a forward (see below). However, it now looks like you may be attempting to put access control in place so that if an a non authenticated user (i.e. some one that is not logged in) navigates to any resource in your web application, they are redirected to a log in page. Or are you trying to make it so that any request is sent through a Controller?
Redirect vs Forward
As I mentioned in my initial post, it is important to understand the difference between a forward and a redirect. Let's say I have a very basic page called somePage.html that is nested in the directory docs/info. In other words, you navigate to www.mysite.com/docs/info/somePage.html to view that page. That page contains a relative link to anotherPage.html such that the anchor tag contains the attribute
href="anotherPage.html". Therefore, if I navigate to www.mysite.com/docs/info/somePage.html and click on the link, I go to www.mysite.com/docs/info/anotherPage.html.
If I have a
redirect configured to handle requests to "/" and redirect those requests to /docs/info/somePage.html, when I go to www.mysite.com the web server sends a redirect
back to the client (i.e. the browser) to the page /docs/info/somePage.html. The browser URL shown in the browser address bar changes from www.mysite.com to www.mysite.com/docs/info/somePage.html and the browser submits a new request to the web server for www.mysite.com/docs/info/somePage.html. As a result, when the browser displayes the page, the relative link on the page resolves to www.mysite.com/docs/info/anotherPage.html.
By contrast, if instead I have a
forward configured to handle requests to "/", when a user goes to www.mysite.com, the web server
internally gets the content from /docs/info/somePage.html and returns it to the client. The client is unaware of this. As such, the URL in the address bar does not change. So the URL still reads www.mysite.com. Moreover, the relative link on the page resolves to www.mysite.com/anotherPage.html. This is most likely an incorrect resolution of the URL. There are times (mostly in the case of servlet mappings rather than html pages) that this may be desirable.
So the use case for a forward and a redirect are different. They each have there uses depending on the goal.
Can you please clarify what your goal is. I will likely need to bow out of the discussion since I am not familiar with Front Man and I do not want to give you incorrect information on how to accomplish your goal if Front Man potentially provides functionality to accomplish your goal. Someone else familiar with the framework can jump in to help. But I think they too will need some clarification of your goal in order to better assist you. (Also, this
thread may need to be moved by a bartender to the
Other Application Frameworks forum if that is the case).