DennisHermannsen Posted May 29, 2019 Share Posted May 29, 2019 (edited) 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 May 29, 2019 by DennisMidjord 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2019 Share Posted May 29, 2019 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. 1 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.