Jump to content

RewriteRules doesn't work in WHMCS


Recommended Posts

Hi,

I'm having trouble rewriting some of the URLs in WHMCS. WHMCS is installed in /client directory.

I want to rewrite all of the product URL (/client/cart.php?gid=1 fx) to /client/cart/<id> or similar.

I've tried this to rewrite it to /client/gid/<id>:

RewriteEngine on
RewriteBase /

RewriteRule ^gid/([^/]*)\.html$ /cart.php?gid=$1 [L]

But that didn't work.

I'm doing this in the .htaccess file in the /client/ directory.

 

Any idea why that won't work?


Edit: Managed to make it work... Forgot to put the rules above the ones created by WHMCS.

Edited by DennisMidjord
Link to comment
Share on other sites

17 minutes ago, DennisMidjord said:

Any idea why that won't work? 

i'm tempted to suggest that it might be Friendly URLs and WHMCS' own redirection/htaccess rules bypassing this.

whether it's even worth spending time trying to get those htaccess to work, I can't say - many have tried. 🙂

I did post an ugly workaround in the thread below that adds redirection rules to the 'page not found' template - I daresay you could expand it to work with product groups...

so that if someone types in /client/cart/minecraft, it redirects to any page/site you specify - could be a sales page, could be the product group in the cart etc

it's obviously not an ideal solution, but unless you crack the htaccess issue, it's a working alternative.

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