« Return to Thread: Facebook Vanity URLs

Re: Facebook Vanity URLs

by mapes911 :: Rate this Message:

Reply to Author | View in Thread

thanks for the suggestions guys!
i actually decided not to try the vanity url for users, but for businesses we are attempting to have a url like

http://<OUR DOMAIN>/business/<USERNAME>

we tried this

        $router = $frontController->getRouter(); // returns a rewrite router by default
       
        $defaults = array(
                'module' => 'default',
                'controller' => 'business',
                'action' => 'view');
       
        $businessRoute = new Zend_Controller_Router_Route('business/:username', $defaults);
       
        $router->addRoute('business', $businessRoute);

but when I go to
http://<DOMAIN>/business/testuser

I get the following
Error: username is not specified

#0 E:\library\Zend\Controller\Router\Rewrite.php(377): Zend_Controller_Router_Route->assemble(Array, true, true)

#1 E:\library\Zend\View\Helper\Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array, NULL, true, true)
#2 [internal function]: Zend_View_Helper_Url->url(Array, NULL, true)
#3 E:\library\Zend\View\Abstract.php(318): call_user_func_array(Array, Array)

#4 [internal function]: Zend_View_Abstract->__call('url', Array)

any ideas what i'm doing wrong?

thanks

 « Return to Thread: Facebook Vanity URLs