• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Renaming Admin.php

James

Well-known member
Ok. This requires getting into the code. This is the relevant code:

library/XenForo/Link.php

Code:
public static function buildAdminLink($type, $data = null, array $extraParams = array())
{
$type = self::_checkForFullLink($type, $fullLink, $fullLinkPrefix);

$link = self::_buildLink('admin', $type, $data, $extraParams);
$queryString = self::buildQueryString($extraParams);

if ($queryString !== '' && $link !== '')
{
$append = $link . '&' . $queryString;
}
else
{
// 1 or neither of these has content
$append = $link . $queryString;
}

if (($hashPos = strpos($type, '#')) !== false)
{
$append .= substr($type, $hashPos);
}

$outputLink = 'admin.php' . ($append !== '' ? '?' : '') . $append;
if ($fullLink)
{
$outputLink = $fullLinkPrefix . $outputLink;
}

return $outputLink;
}

You can see this line in there which specifies the file name:

Code:
$outputLink = 'admin.php' . ($append !== '' ? '?' : '') . $append;

If you change the file name here and then rename the file on your server then that will change the location of the Admin CP.

Remember, you'll need to re-apply this modification after each upgrade and update any shortcut links to the admin CP (such as the top right corner) by making the relevant template code changes.
 
there is 2 links to admin.php page, i think they need to change after this changing proccess

(per this post)

Changing that one line of code updates all links within the Admin CP. That is the only change that is required. The other instances are just shortcuts to get to the Admin CP, like this one at the top of the forum:

Screen shot 2011-05-17 at 11.18.47 PM.webp

You can just manually visit the new URL when you need to visit the Admin CP, rather than use the shortcut.
 
Top Bottom