mydatacenter Posted October 5, 2014 Share Posted October 5, 2014 hello, I would ENTERING htaccess file to rewrite the url of the file cart Example: monsite.com/cart.php/?gid=1 in monsite.com/hosting.xlm Thank you in advance for your help 0 Quote Link to comment Share on other sites More sharing options...
lowprofiler Posted October 10, 2014 Share Posted October 10, 2014 Is there any people who had some luck with rewriting the cart? I see a lot of whmcs pages with cart rewrite... Someone who would like to share? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 10, 2014 Share Posted October 10, 2014 There are two possible approaches. Let's suppose that the group name that you want to rewrite is Hosting. Add this rewrite rule in your .htaccess file. RewriteRule ^Hosting /cart.php?gid=1[L] Your example.com/cart.php?gid=1 is accessible also from example.com/Hosting. Now here comes the boring part. All links (prevalently a href and form action) in the template of your WHMCS cart still point to the old URL and this is not good for two reasons: Avoid duplicate contents Keep visitors on the same URL You have to open all your templates and look for lines like this one: cart.php?gid={$smarty.get.gid} Replace with: {$productgroup.name} This approach is very basic and manual-made. The second approach is to make all this stuff automatically with a script but it takes more time. 0 Quote Link to comment Share on other sites More sharing options...
lowprofiler Posted October 12, 2014 Share Posted October 12, 2014 Awesome. I will definately try this and return! thanks! 0 Quote Link to comment Share on other sites More sharing options...
mydatacenter Posted October 15, 2014 Author Share Posted October 15, 2014 Hello everyone, Already to start I wanted to say a big thank you. Your system works very well, I had my last question. How to do a rewrite on the direct link to the basket. Example: https://www.mydomain.com/cart.php?a=add&pid=1 in https://www.mydomain.com/hebergement-mutualizes. A big thank you 0 Quote Link to comment Share on other sites More sharing options...
mydatacenter Posted October 16, 2014 Author Share Posted October 16, 2014 Hello everyone, I want to thank you for your help, your system is operating at 100%. A big thank you 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 16, 2014 Share Posted October 16, 2014 Nice Anyway have you managed to make it? Example: https://www.mydomain.com/cart.php?a=add&pid=1 in https://www.mydomain.com/hebergement-mutualizes. 0 Quote Link to comment Share on other sites More sharing options...
mydatacenter Posted October 16, 2014 Author Share Posted October 16, 2014 hello, Yes, I managed, because of you. A big thank you, I look long, however, is with you it was easy. Another big thank you 0 Quote Link to comment Share on other sites More sharing options...
nocovia Posted February 17, 2016 Share Posted February 17, 2016 There are two possible approaches. Let's suppose that the group name that you want to rewrite is Hosting. Add this rewrite rule in your .htaccess file. RewriteRule ^Hosting /cart.php?gid=1[L] Your example.com/cart.php?gid=1 is accessible also from example.com/Hosting. Now here comes the boring part. All links (prevalently a href and form action) in the template of your WHMCS cart still point to the old URL and this is not good for two reasons: Avoid duplicate contents Keep visitors on the same URL You have to open all your templates and look for lines like this one: cart.php?gid={$smarty.get.gid} Replace with: {$productgroup.name} This approach is very basic and manual-made. The second approach is to make all this stuff automatically with a script but it takes more time. Hello, Thank you for your input on this. I am trying to accomplish the same thing as the OP. The version of WHMCS I am using is 6. I was able to get the first step done by updating my htaccess. The friendly URLs work, but like you said, all the links generated in the template files point to the gid url. The second step is not going as well. When I open the cart tpl files I do not see {$smarty.get.gid} what I do see is href="{$item->getUri()}" . Has getUri replaced smarty in v6? Does your solution work in v6? Thanks! Warren 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.