Phillys93 Posted September 30, 2013 Share Posted September 30, 2013 (edited) Hello! I would like to redirect my users to the homepage on login. What is the best way to do that? Using mod_rewrite rule in .htaccess or modyfi controller? Please leave a example. Thanks /P Edited September 30, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 30, 2013 Share Posted September 30, 2013 I would modify the authcontroller! I think it can be enough to modify everyone of these entries: Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); To Tools::redirect('index.php'); Haven't tested it but it should work! 3 Link to comment Share on other sites More sharing options...
vekia Posted September 30, 2013 Share Posted September 30, 2013 in authentication.tpl file instead of: {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if} use this: <input type="hidden" class="hidden" name="back" value="HTTP://YOURWEBSITE.COM/" /> of course change HTTP://YOURWEBSITE.COM/ to your website url 1 Link to comment Share on other sites More sharing options...
Phillys93 Posted September 30, 2013 Author Share Posted September 30, 2013 (edited) Nemo1: I will try that! Valkia: Okay, but that leaves me with one problem. I have a multistore prestashop installation which means that i have different URLs for different shops. Edited September 30, 2013 by Phillys93 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 30, 2013 Share Posted September 30, 2013 You can use my solution then, it will redirect to the current home Or, you can use {$base_url} instead of hardcoding the site's name with vekia's solution 2 Link to comment Share on other sites More sharing options...
vekia Posted September 30, 2013 Share Posted September 30, 2013 that's right, {$base_uri} will solve problem with multistore Link to comment Share on other sites More sharing options...
Phillys93 Posted September 30, 2013 Author Share Posted September 30, 2013 Nemo1's soulution worked! Link to comment Share on other sites More sharing options...
vekia Posted September 30, 2013 Share Posted September 30, 2013 ok, thank you for information now i can mark this thread as [solved] with regards Milos Link to comment Share on other sites More sharing options...
parsifal Posted February 3, 2014 Share Posted February 3, 2014 Hi guys, Any idea why both of the solutions you posted above would not work in my installation? I use version 1.5.3.1. Could this be the reason? Thanks! Link to comment Share on other sites More sharing options...
NemoPS Posted February 3, 2014 Share Posted February 3, 2014 Weird! Have you overridden the controller? Or hardcoded those changes? Link to comment Share on other sites More sharing options...
parsifal Posted February 3, 2014 Share Posted February 3, 2014 Neither. Although, the string you mentioned in post #2: Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); is not present "as is" in 1.5.3.1 and I had to improvise a little. Maybe I missed something. I'm attaching the unmodified v1.5.3.1 AuthController.php, in case it helps: AuthController.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now