Answers.Body: <p>I would try and put the port in your siteUrl config param:</p>
  
  <pre><code>'siteUrl' =&gt; 'http://localhost:8888',
  </code></pre>
  
  <p>Alternatively you might be able to use this though haven't tested it (I believe the php server variable uses the server name &amp; port number):</p>
  
  <pre><code>'localhost' =&gt; array(
      'siteUrl' =&gt; 'http://'.$_SERVER['HTTP_HOST'],
      'devMode' =&gt; true,
      'cacheMethod' =&gt; 'file'
  )
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T14:36:00.827Z
Answers.Text: Thanks a lot. Using 'siteUrl' => 'http://'.$_SERVER['HTTP_HOST'] inside my config file fixed the issue for me.
Answers.UserDisplayName: Davers
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T08:05:59.117Z
Answers.LastActivityDate: 2016-10-07T08:05:59.117Z
Answers.UserDisplayName: joep
Answers.Body: <p>Are you required to run port 8888? If not, you can set the port to 80 in MAMP and this would resolve the issue. I know this is not really a fix for your problem but it might be a potential work-around.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T08:44:44.387Z
Answers.LastActivityDate: 2016-10-07T08:44:44.387Z
Answers.UserDisplayName: Ragnarsson
Body: <p>I'm running Craft CMS with MAMP at <code>localhost:8888</code>.</p>
  
  <p>When I pass in a URL with <code>{{ entry.title }}</code>, I get <a href="http://localhost/news/2016/we-just-installed-craft" rel="nofollow">http://localhost/news/2016/we-just-installed-craft</a> which gives me a 404 until I manually put in the <code>:8888</code> after localhost.</p>
  
  <p>Am I missing something in the set up here?</p>
  
Tags: <url><routes><mamp>
Title: URL drops :8888 from localhost
ThreadText: # URL drops :8888 from localhost
  
  (Asked by: username_0 on 2016-10-07)
  
  I'm running Craft CMS with MAMP at `localhost:8888`.
  
  When I pass in a URL with `{{ entry.title }}`, I get <http://localhost/news/2016/we-just-installed-craft> which gives me a 404 until I manually put in the `:8888` after localhost.
  
  Am I missing something in the set up here?
  
  **Tags:** url, routes, mamp
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-10-07. Score: 3 | Accepted answer
  
  I would try and put the port in your siteUrl config param:
  
  ```
  'siteUrl' => 'http://localhost:8888',
  
  ```
  
  Alternatively you might be able to use this though haven't tested it (I believe the php server variable uses the server name & port number):
  
  ```
  'localhost' => array(
      'siteUrl' => 'http://'.$_SERVER['HTTP_HOST'],
      'devMode' => true,
      'cacheMethod' => 'file'
  )
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks a lot. Using 'siteUrl' => 'http://'.$_SERVER['HTTP_HOST'] inside my config file fixed the issue for me.  
  
  ---
  
  ### Answer by username_2 on 2016-10-07. Score: 2
  
  Are you required to run port 8888? If not, you can set the port to 80 in MAMP and this would resolve the issue. I know this is not really a fix for your problem but it might be a potential work-around.
  
  
  ---
  
  