If your httpd.conf installed correctly, this RewriteBase / not needed
in RewriteCond %{REQUEST_URI} cpanel/(.*)$ part should be ^cpanel/(.*)$ . Without it, every URL containing "..cpanel / something .." will match.
I assume that in ...?f=%{REQUEST_URI} you want to pass the URL that the client requested for index.php (possibly to register 404's). However, if REQUEST_URI contains unwanted characters (e.g. & ), this will lead to unexpected behavior, for example. only the part before & from REQUEST_URI will be passed as the value of the parameter f , after & part will be another, newly created GET parameter. (Please, try.)
You can get the (original) REQUEST_URI in php with $_SERVER['REQUEST_URI'] . Your .htaccess will be more clear if you omit this part.
The last two rules deserve the flag [L] , but this is not important, however, if you do not want to bind your rules, it is always useful to add the flag [L] to ensure safety and maintainability.
I think your .htaccess is fine except for these little things.
source share