biffwaff Posted March 29, 2019 Share Posted March 29, 2019 Hi. How can I make Nginx friendly urls? I found some other post about this but their configuration does not work anymore. # WHMCS CONFIG location ~ /billing/announcements/?(.*)$ { rewrite ^/(.*)$ /account/index.php?rp=/announcements/$1; } location ~ /billing/downloads/?(.*)$ { rewrite ^/(.*)$ /account/index.php?rp=/downloads/$1; } location ~ /billing/knowledgebase/?(.*)$ { rewrite ^/(.*)$ /account/index.php?rp=/knowledgebase/$1; } # END WHMCS CONFIG When I add this to the configuration file and go to https://example.com/billing/knowledgebase it just displays No input file specified. 0 Quote Link to comment Share on other sites More sharing options...
biffwaff Posted March 29, 2019 Author Share Posted March 29, 2019 And when adding location /billing/ { try_files $uri $uri.php $uri/; } to try and remove the .php from the url it just downloads the file instead?! Like /billing/clientarea 0 Quote Link to comment Share on other sites More sharing options...
wp4all Posted March 30, 2019 Share Posted March 30, 2019 Hi @dolios, nice how to for NGINX rewrites: https://www.codesmite.com/article/clean-url-rewrites-using-nginx Have fun Christian 0 Quote Link to comment Share on other sites More sharing options...
biffwaff Posted March 30, 2019 Author Share Posted March 30, 2019 2 minutes ago, wp4all said: Hi @dolios, nice how to for NGINX rewrites: https://www.codesmite.com/article/clean-url-rewrites-using-nginx Have fun Christian Hi @wp4all I have now fixed this, at least for client area. But how do I make it so whmcs uses /login instead of /clientarea.php 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted April 1, 2019 Share Posted April 1, 2019 Do you mean in its own links like in email templates? Or do you mean setup nginx to rewrite /login to /clientarea.php? 0 Quote Link to comment Share on other sites More sharing options...
biffwaff Posted April 1, 2019 Author Share Posted April 1, 2019 1 minute ago, steven99 said: Do you mean in its own links like in email templates? Or do you mean setup nginx to rewrite /login to /clientarea.php? The rewrite is no problem, but in whmcs how can i make the buttons go to the new url? 0 Quote Link to comment Share on other sites More sharing options...
wp4all Posted April 2, 2019 Share Posted April 2, 2019 Good morning @dolios, do you have an Screenshot which button you mean ? There are a lot in WHMCS. Greetings Christian 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted April 2, 2019 Share Posted April 2, 2019 23 hours ago, dolios said: The rewrite is no problem, but in whmcs how can i make the buttons go to the new url? The only button that would need to go to /login is the login button. Email templates would also need to be changed that gave the clientarea.php address. Or do you mean you want to clientarea.php no matter the access point show as /login/ or even /clients/ ? Though if you use relative URLs for images, CSS, etc, doing /login/ may mess those up as they would want to pull from /login/templates/blah/images/image.blah. 0 Quote Link to comment Share on other sites More sharing options...
Villavu Posted April 13, 2019 Share Posted April 13, 2019 I made a tutorial for this that will work in WHMCS 7.7. https://hostup.org/blog/whmcs-friendly-urls-configuration-for-nginx/. If you are using example.com/billing as your whmcs installation directory then this will work just fine. If not, then just replace /billing/ with your URL. 0 Quote Link to comment Share on other sites More sharing options...
biffwaff Posted April 27, 2019 Author Share Posted April 27, 2019 1 On 13/04/2019 at 1:52 PM, Villavu said: I made a tutorial for this that will work in WHMCS 7.7. https://hostup.org/blog/whmcs-friendly-urls-configuration-for-nginx/. If you are using example.com/billing as your whmcs installation directory then this will work just fine. If not, then just replace /billing/ with your URL. Hi. Thank you it works. 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted April 28, 2019 Share Posted April 28, 2019 Good luck with that. WHMCS has hardcoded the file names and paths into the PHP code. You are only going to get to a certain point with rules until you find out internal functions are not working because they try to find the files in another place. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Lawrence Posted May 2, 2019 WHMCS Technical Analyst II Share Posted May 2, 2019 As long as the nginx rewrites are re-implementations of the existing rules we provide in current releases in the .htaccess file, they should work. However a quick check of the ones provided in this thread reveals that they may all be incomplete in one way or another, so they may not work as expected in all URL writing methods used for the Friendly URLs setting under Setup > General Settings > General tab. 0 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.