Jump to content

Nginx friendly urls


Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...
 
 
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.

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated