I have my local dev setting up using MAMP on port 8888

  'mydomain.dev:8888' => array(
    // ...
    'environmentVariables' => array(
        'basePath' => '/Users/mypath/SiteCode/mydomain/dev/',
        'baseUrl'  => '//mydomain.dev:8888/',
        'logDumpMethod' => 'print_r'
    'logDumpMethod' => 'print_r',
    'devMode' => true,
    'useCompressedJs' => true,
    'siteUrl' => array(
        'en' =>  'http://mydomain.dev:8888/en/',
        'ar' =>  'http://mydomain.dev:8888/ar/',
        'zh' =>  'http://mydomain.dev:8888/zh/',
        'fil' => 'http://mydomain.dev:8888/fil/',
        'fr' =>  'http://mydomain.dev:8888/fr/',
        'hi' =>  'http://mydomain.dev:8888/hi/',
        'id' =>  'http://mydomain.dev:8888/id/',
        'ru' =>  'http://mydomain.dev:8888/ru/',
        'es' =>  'http://mydomain.dev:8888/es/',
        'tr' =>  'http://mydomain.dev:8888/tr/',
        'uk' =>  'http://mydomain.dev:8888/uk/',
        'ur' =>  'http://mydomain.dev:8888/ur/'


In the admin general settings I am using {siteUrl} for siteUrl settings. This gets read from the local dev config array as above.

However the admin link on the site in the control panel top left gets the url wrong. Instead of http://mydomain.dev:8888 it shows http://mydomain.dev:8888/admin/%7BsiteUrl%7D/

I have other local craft sites setup with port number 8888 O.K. The only difference here is that the siteUrl is specified in a multilingual array.

Is this a bug or am I missing something?

1 Answer 1


Pretty sure the issue is that a port number won't work as part of the key in a multi-environment config. Because unless you explicitly set CRAFT_ENVIRONMENT to use it, Craft is just going to use $_SERVER['SERVER_NAME'], which doesn't include the :port (that's at $_SERVER['SERVER_PORT']).

There's another thread here with some solutions/workarounds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.