Jump to content

cart rewrite


mydatacenter

Recommended Posts

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:

 

  1. Avoid duplicate contents
  2. 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.

Link to comment
Share on other sites

  • 1 year later...
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:

 

  1. Avoid duplicate contents
  2. 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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated