Craft Posted October 28, 2020 Share Posted October 28, 2020 Hi guys, I would like to forward any access to cart.php page to another page (clientarea.php for example) I can do it using Hook or Redirect URLs from cPanel, but my issue that I don't want to redirect it's parameters too like (cart.php?a=view), (cart.php?a=add&domain=register), etc.. How can I do that? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 28, 2020 Share Posted October 28, 2020 4 minutes ago, Craft said: I can do it using Hook or Redirect URLs from cPanel, but my issue that I don't want to redirect it's parameters too like (cart.php?a=view), (cart.php?a=add&domain=register), etc.. just to double check - you want viewcart, domainregister etc to work, but redirect other pages... or you want to totally prevent access to all cart.php pages for everyone ?? 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted October 28, 2020 Author Share Posted October 28, 2020 9 minutes ago, brian! said: just to double check - you want viewcart, domainregister etc to work, but redirect other pages How? Â 9 minutes ago, brian! said: you want to totally prevent access to all cart.php pages for everyone ?? Yes, because I hide all the products to appear at cart.php, so this page is useless. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 28, 2020 Share Posted October 28, 2020 (edited) let me give you two answers, and then you figure out which suits your situation best... 1. redirect everyone away from cart.php... <?php # Redirect Cart Visitors Hook # Written by brian! function redirect_cart_vistors($vars) { header("Location: clientarea.php"); exit; } add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors"); 2. redirect everyone away from the products page, but leave the other cart pages working... my suspicion is that you'll need the second option - as looking at your site, I think you still need the other pages of the cart to work. Edited October 28, 2020 by brian! 1 Quote Link to comment Share on other sites More sharing options...
Craft Posted October 28, 2020 Author Share Posted October 28, 2020 25 minutes ago, brian! said: 2. redirect everyone away from the products page, but leave the other cart pages working... my suspicion is that you'll need the second option - as looking at your site, I think you still need the other pages of the cart to work. Yes, that's what I need exactly. <?php # Redirect Cart Visitors Hook for SteelSignature # Written by brian! function redirect_cart_vistors($vars) { if ($vars['templatefile'] === 'products'){ header("Location: clientarea.php"); exit; } } add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors"); ?> Thank you 🙂 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.