I am working on a new site, and it will be based on (so far) Zend Framework.
I need the best approach to make www.example.com/user work to display the 'user'.
However since it may have other items on the site, such as www.example.com/help etc that still needs to goto the 'help' controller.
i would effectively like to say if its one level i.e. example.com/<whatever> that it will be redirected to www.example.com/profile/person/<whatever>
Now the question is - I can work with the Zend Framework's error controller to detect if it is an invalid controller (and block all usernames from being the same as any of the controllers) then display the profile, OR redirect to the profile.
This method would make:
Check -> no big.nerd controller found -> Passes to Error Controller.
Error Controller -> Search for User, if Found, redirect to www.example.com/profile/person/big.nerd .. and if not .. display not found error / etc.
I am absolutely terrible at URL rewriting, so I won't even venture a guess as to how I would do it.
If i've made any sense at all, I am looking for any recommendations on the best approach would be?
Example of Standard Zend Framework .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
Thanks in advance for any advice anyone can give me.