Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » handling different ports in URLs

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1283 Views
  • splatEric
    Avatar
    Community Member
    15 Posts

    handling different ports in URLs Link to this post

    Hi,

    I've just been working with the pagination recipe for my implementation of a news index page. It was working fine, except the $NextLink and $PrevLink values weren't working properly. Looking at the URLs that were being produced, I could see that the port of my development server address was not being inserted into the absolute URL that these values were being defined with.I am using MAMP on OSX, which is running over port 8888.

    I took a look through the forums, but couldn't find anyone mentioning this. so in the spirit of adventure/sheer bloodymindedness, I went in search of where this URL was being defined. I dug it out and have patched my local code to fix this problem:

    sapphire/core/HTTP.php

    115,118d114
    <             isset($parts['port']) && $parts['port'] != ''
    <             ? ':' . $parts['port']
    <             : ''
    <          ) . (

    No idea if this information will be useful to anyone or not, but thought I'd throw it out there for anyone else who runs across a similar problem

    cheers

    Mike

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: handling different ports in URLs Link to this post

    Might be good to file this as a ticket on open.silverstripe.org if this is still an issue for you in 2.4.

  • becca
    Avatar
    Community Member
    5 Posts

    Re: handling different ports in URLs Link to this post

    This was great! I was just starting to dig into HTTP.php, as I was having the same problem. You just saved my evening!

  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Re: handling different ports in URLs Link to this post

    Yeah I had the same problem too, this fixed the problem

    1283 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.