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?

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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