Site icon Osclass Documentation & Knowledge Base

Change backoffice (oc-admin) directory name

In case there is requirement to change oc-admin (backoffice) folder, this option has been added from Osclass version 8.0. There can be different reasons why backoffice folder name/path should be changed:

There are few simple steps to properly change backoffice address:

  1. Login to your file system / FTP and change name of oc-admin folder (i.e. xa1fsade8) so it is difficult to identify backoffice folder without knowing this information. Do not put this into your robots.txt as this file is readable by anyone and can find this information there.
  2. Open your config.php (in root folder where your osclass is installed) and at bottom of this file add following line:
define('OC_ADMIN_FOLDER', 'xa1fsade8');

Note that ‘xa1fsade8’ is new name of your oc-admin folder and can be whatever you want or like.

Check your plugins

Keep in mind that some older plugins may have problem with your new backoffice URL and you will not be able to get into configuration pages of these plugins. This happens when plugin use hardly defined “oc-admin” word in URL.

In this case, easiest way to get into configuration page, is simply update in browser navigator bar “oc-admin” to your new backoffice directory name.

Alternatively, you can update index.php of plugin (and maybe other files as well) and use following function to always use proper backoffice address:

<?php echo osc_admin_base_url(true); ?>

Function will return ‘https://yourdomain.com/oc-admin/index.php’ and in case oc-admin folder name was changed, it will be reflected there.