-1

When a user visits http://48n.ca/48/

and selects the home link my elastic ip from ec2 is displayed. I would like for 48n.ca/48 to remain visible in adress bar.

Thanks for the help I am a huge noob.

48n
  • 1
  • 2

2 Answers2

0

The Home link uses the IP address. My guess is that your code is somehow using the server own internal host name for itself rather than the host name you user used in the browser to generate this link. You could consider simply changing the link href to / instead of the full server name.

Looking at your headers, it seems you are running PHP. My guess is that you are using $_SERVER['SERVER_NAME'] or $_SERVER['SERVER_ADDR'] to generate this host name portion of this link, when you should be using $_SERVER['HTTP_HOST']. Or you can simply use / as I mentioned previously.

I had answered a previous question here on the differences between these variables: PHP: $_SERVER variables: $_SERVER['HTTP_HOST'] vs $_SERVER['SERVER_NAME']

I hope you find that useful.

Community
  • 1
  • 1
Mike Brant
  • 70,514
  • 10
  • 99
  • 103
0

Just to clarify if any other noob need a step by step,

I went into wordpress,

appearance - menu - changed custom link from ip xx.xxx.xxx.xx to http//:www.example.com

Thank you @mike brant

48n
  • 1
  • 2
  • You should mark this as answer since this is what you needed to do fix this within Wordpress. You should also tag your question with PHP and Wordpress and possibly change the title to reflect the problem more correctly for future users to find. – Mike Brant Nov 04 '14 at 20:14