Skip to main content

How to enable .htaccess for our plugins?

Comments

8 comments

  • 24x7server
    Hi, No, WHM works differently not on Apache. You can create index page and meta tags for redirection to the URL of your choice or file of your choice if .htaccess is not working as expected for you.
    0
  • cPanelMichael
    Hello @shazde, The Web Host Manager interface does not utilize the Apache web server that your websites use. Have you tried configuring the redirect in the script itself? Here's a StackOverflow discussion you may find helpful: How to redirect from one CGI to another Thank you.
    0
  • shazde
    The CGI header redirect won't help us here. What we want to achieve is to have: /our-plugin/none/existing/path to redirect to /our-plugin/index.cgi then our plugin is going to look into the request path and decide how to handle it. The goal is to have a single cgi file per plugin that can handle all requests to that plugin.
    0
  • cPanelMichael
    Hello @shazde, Can you provide some more information on why you'd need to utilize paths or links that do not exist? For instance, if the plugin is accessible through Web Host Manager, under what scenario would someone access the wrong directory or URL? Thank you.
    0
  • shazde
    We do not want to have separated CGI files for every single page that our plugin needs to support. It would be great if we can have something similar to mod_rewrite here.
    0
  • cPanelMichael
    /our-plugin/none/existing/path to redirect to /our-plugin/index.cgi then our plugin is going to look into the request path and decide how to handle it. The goal is to have a single cgi file per plugin that can handle all requests to that plugin.

    Hello @shazde, Can you provide a CODE example and step-by-step instructions of how we can reproduce the issue you are describing when setting up a WHM plugin? Thank you.
    0
  • shazde
    Hi, Our code is Golang and we want WHM server to perform as below: Assuming we have index.cgi under our CGI directory. we want /index.cgi/path1/path2 also call /index.cgi rather than displaying a 404 error.
    0
  • cPanelMichael
    Hello @shazde, I'm not aware of any methods you could use to implement those rewrite rules in a WHM plugin. You could send an email to integration@cpanel.net explaining the situation to see if any of our Developers can share some insight into how you might implement that with your plugin. Thank you.
    0

Please sign in to leave a comment.