开发者

Rewrite url in social engine

开发者 https://www.devze.com 2023-04-02 02:14 出处:网络
I am using social engine, I want to change my url from www.example.com/signup to www.开发者_如何学Goexample.com/activate, sorry I want to keep both urls. please let me know how to do thisPut this code

I am using social engine, I want to change my url from www.example.com/signup to www.开发者_如何学Goexample.com/activate, sorry I want to keep both urls. please let me know how to do this


Put this code in your public/index.php file.

$FrontController = Zend_Controller_Front::getInstance();
$Router = $FrontController->getRouter();
$Router->addRoute("activate",
new Zend_Controller_Router_Route
(
"/activate",
array
("controller" => "signup",
"action" => "index"
)
));

here: activate is the name of the router. /activate is the url you want as address, controller and action is self descriptive.


In application/modules/Use/settings/manifest find these lines:

    'user_signup' => array(
        'route' => '/signup/:action/*',
        'defaults' => array(
        'module' => 'user',
        'controller' => 'signup',
        'action' => 'index'
     )

Change /signup/:action/ to /activate/:action.


You could modify your .htaccess to create redirects, refer to this example

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号