whmcs - Whmcs 友好的 URL 设置不适用于 nginx。我怎样才能解决这个问题?
问题描述
我正在尝试在 whmcs 上设置完整的友好 url,但我无法使配置正常工作。我尝试了各种配置,但似乎都不起作用,而那些起作用的配置会破坏其他东西,例如管理员 URL。
https://whmcs.community/topic/291496-moderncurrent-76-nginx-rules/ 我试过这个,但它不适用于所有 URL
解决方案
试试这些配置
location ~ /billing/announcements/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/announcements/$1;
}
location ~ /billing/downloads/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/downloads/$1;
}
location ~ /billing/knowledgebase/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/knowledgebase/$1;
}
location ~ /billing/store/ssl-certificates/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/ssl-certificates/$1;
}
location ~ /billing/store/sitelock/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/sitelock/$1;
}
location ~ /billing/store/website-builder/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/website-builder/$1;
}
location ~ /billing/store/order/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/order/$1;
}
location ~ /billing/download/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/download$1;
}
location ~ /billing/cart/domain/renew/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/cart/domain/renew$1;
}
location ~ /billing/knowledgebase/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/knowledgebase/$1;
}
location ~ /billing/store/ssl-certificates/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/ssl-certificates/$1;
}
location ~ /billing/store/sitelock/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/sitelock/$1;
}
location ~ /billing/store/website-builder/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/website-builder/$1;
}
location ~ /billing/store/order/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/store/order/$1;
}
location ~ /billing/download/?(.*)$ {
rewrite ^/(.*)$ /billing/index.php?rp=/download$1;
}
location ~ /billing/admin/setup/authn/view/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/authn/view/$1;
}
location ~ /billing/admin/apps/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/apps$1;
}
location ~ /billing/admin/setup/notifications/overview/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/notifications/overview$1;
}
location ~ /billing/admin/setup/storage/index/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/storage/index$1;
}
location ~ /billing/admin/setup/payments/tax/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/payments/tax$1;
}
location ~ /billing/admin/help/license/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/help/license$1;
}
location ~ /billing/admin/setup/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup$1;
}
location ~ /billing/admin/utilities/system/php-compat/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/utilities/system/php-compat$1;
}
location ~ /billing/admin/services/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services$1;
}
location ~ /billing/admin/services/shared/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/shared$1;
}
location ~ /billing/admin/services/reseller/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/reseller$1;
}
location ~ /billing/admin/services/server/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/server$1;
}
location ~ /billing/admin/services/other/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/other$1;
}
location ~ /billing/admin/addons/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/addons$1;
}
location ~ /billing/admin/domains/?(.*)$ {
rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/domains$1;
}
推荐阅读
- jenkins - jenkins 在哪里存储 Global Pipeline/Shared Libraries?
- c++ - 如何在linux上的vscode中完成脚本后插入新行?
- c# - 如何从 ISO-8859-1 转换为 UTF-8?
- python - Python:为什么这个生成器不能从 yield 继续?
- sql - tsqlt FakeTable在执行单元测试后不回滚
- c# - 如何从 C# 中的选定类中获取变量的值?
- r - 为函数中的变量传递参数
- tomcat - 如何在 Log4j 2 Socket appender 中覆盖 DefaultErrorHandler?
- python - 返回 401 Jwt 颁发者的 Cloud Endpoints 未配置
- ios - iOS 上的 HTTP 资源