Mình có sử dụng WHMCS trên một VPS chạy hostvn scripts. Tuy nhiên mình có tinh chỉnh một chút ở WHMCS nên mặc định nó không có sử dụng được chức năng write. Cần sửa lại một chút ở file write của whmcs.conf
Chúng ta cần mở file /etc/nginx/rewrite/whmcs.conf và sửa thành nội dung như dưới đây
location ~ /announcements/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/announcements/$1; }
location ~ /download/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/download$1; }
location ~ /knowledgebase/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/knowledgebase/$1; }
location ~ /store/ssl-certificates/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/store/ssl-certificates/$1; }
location ~ /store/sitelock/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/store/sitelock/$1; }
location ~ /store/website-builder/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/store/website-builder/$1; }
location ~ /store/order/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/store/order/$1; }
location ~ /cart/domain/renew/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/cart/domain/renew$1; }
location ~ /account/paymentmethods/?(.*)$ { rewrite ^/(.*)$ /index.php?rp=/account/paymentmethods$1; }
location ~ /ADM/(addons|apps|domains|help\/license|services|setup|utilities\/system\/php-compat)(.*) {
rewrite ^/(.*)$ /ADM/index.php?rp=/admin/$1$2 last;
}
location / {
# Redirect directories to an address with slash
if (!-d $request_filename){
rewrite ^/(.+)/$ /$1 permanent;
}
# Send all remaining (routable paths) through index.php
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php last;
}
}
Trong đó, bạn sẽ thấy có dòng dưới đây
location ~ /ADM/(addons|apps|domains|help\/license|services|setup|utilities\/system\/php-compat)(.*) {
rewrite ^/(.*)$ /ADM/index.php?rp=/admin/$1$2 last;
Dòng này mình phải sửa lại vì mình có custom path của thư mục admin. Bình thường nếu bạn không đổi gì thì ở đó sẽ là admin nha.
Sau đó restart NGINX là có thể sử dụng friendly urls của WHMCS rồi.
















![[Step by Step] – Hướng dẫn cài đặt Webmin Control Panel trên Raspberry Pi](https://vpsvietnam.com/wp-content/uploads/2022/01/Webmin-in-Raspberry-Pi-360x180.jpg)





