Skip to content

Instantly share code, notes, and snippets.

@xyzulu
Forked from Bharat-B/readydedis.com.conf
Last active March 7, 2024 12:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save xyzulu/dbe2762c131b7bf3fbfc67056a565ae0 to your computer and use it in GitHub Desktop.
Save xyzulu/dbe2762c131b7bf3fbfc67056a565ae0 to your computer and use it in GitHub Desktop.
nGINX rewrite rules for whmcs 8
location ~ /clients/admin/(client!\.php|client/(.*)|table/(.*)|search!\.php|search/(.*)|apps|billing|setup|user|services|addons|domains|utilitiesemailmarketer!\.php|utilities/(.*)|logs|help!\.php|help/license|modules|image/(recent|upload)|validation_com/(.*))/?(.*)$ {
rewrite ^/(.*)$ /clients/admin/index.php?rp=/admin/$1/$2;
}
location ~ /clients/(images/em|invoice|domain|login|invite|password|account|store|download|knowledgebase|announcements|clientarea/ssl-certificates|user/(verification|accounts|profile|password|security|verify)|cart/(domain/renew)|domain/pricing|cart/order|images/kb)/?(.*)$ {
rewrite ^/(.*)$ /clients/index.php?rp=/$1/$2;
}
location ~ /clients/auth/manage/client/links/?(.*)$ {
rewrite ^/(.*)$ /clients/index.php?rp=/auth/manage/client/links$1;
}
location ^~ /clients/vendor/ {
deny all;
return 403;
}
@xyzulu
Copy link
Author

xyzulu commented Jul 11, 2023

Replace 'clients' with the name of your folder where WHMCS resides.
As of today, these as the updated rules that WHMCS requires on Nginx for rewriting (full friendly urls) to work.

@xyzulu
Copy link
Author

xyzulu commented Aug 11, 2023

Added rewrite for /clients/invite

@xyzulu
Copy link
Author

xyzulu commented Oct 18, 2023

Added rewrite for /clients/domain (domain renewals)

@NNBAtes
Copy link

NNBAtes commented Feb 20, 2024

Is this perfect file for whmcs 8.8 sir ?
Because I still can get /index.php?rp= after redirect

@xyzulu
Copy link
Author

xyzulu commented Feb 20, 2024

It was working for me.. I recently switched to OLS, so I don't use these redirects at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment