Osclass allows administrators to change the name of the oc-admin
directory to enhance security and obscure the CMS being used. This feature has been available since Osclass version 8.0. Changing the backoffice folder name can help in the following scenarios:
Access your file system via FTP, SFTP, or a file manager in your hosting panel. Locate the oc-admin
folder in the root directory of your Osclass installation and rename it to a new, difficult-to-guess name (e.g., xa1fsade8
).
After renaming the folder, you need to inform Osclass about the new name. Open the config.php
file located in the root directory of your Osclass installation and add the following line at the bottom:
define('OC_ADMIN_FOLDER', 'xa1fsade8');
Replace xa1fsade8
with your new backoffice directory name. Save and close the file.
After making these changes, you can access your backoffice using the new directory name:
https://yourdomain.com/xa1fsade8/
If your Osclass installation is in a subdirectory, the new login URL would be:
https://yourdomain.com/subdirectory/xa1fsade8/
Some older plugins may use a hardcoded oc-admin
path in their URLs, which can cause issues accessing their configuration pages. If you encounter this issue, you have two options:
When attempting to access a plugin’s settings page, if the URL still contains oc-admin
, manually replace it in your browser’s address bar with your new backoffice directory name.
To permanently fix the issue, modify the plugin’s files to use the correct admin URL dynamically. Locate the index.php
file in the plugin directory (or any file that generates admin links) and replace hardcoded URLs with the following function:
<?php echo osc_admin_base_url(true); ?>
This function dynamically generates the correct admin panel URL, ensuring compatibility even if the backoffice folder name is changed.
Renaming the oc-admin
folder is an effective way to enhance security and obscure your Osclass installation. However, be mindful of plugin compatibility and update your configuration files accordingly. If any plugin stops working due to this change, updating its URLs to use osc_admin_base_url(true);
will resolve the issue.