How to enable .htaccess for our plugins?
Hi,
For a new plugin, I need to have all URLs to be redirected to our index.cgi file.
To achieve this I uploaded an htaccess file our plugin directory but that didn't work and unfortunately, I can't find the apache configuration file for WHM service.
1. Does WHM run under Apache?
2. If yes where is the config file located?
3. If not how can I make sure all URLs under for my plugin are redirected to a single index.cgi file?
-
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 -
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 -
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 -
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 -
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 -
/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 -
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 -
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.
Comments
8 comments