1

I was able to get myExample.ddns.net to point to my local computer successfully. Unfortunately, only the text shows up. All of the CSS styling is missing, and same with the images. If I go to another virtual host that points to the same folder on my computer, everything displays perfectly.

Any idea on why the CSS styling and images are missing ONLY when coming in through the dynamic DNS service offered by noIP.com ?

Thanks!

PioneerMan
  • 303
  • 4
  • 12

1 Answers1

2

It sounds like you have a <base> tag rewriting all your urls to something not related. Remove the base tag from your page HEAD, and your CSS and JS will start to load correctly:

<base href='...' />

Read more about the base tag here.

Maximillian Laumeister
  • 19,884
  • 8
  • 59
  • 78
  • Thanks Maximillian, the CSS styling is now showing because I commented out the base tag. But if I click on any of the links, they are now broken. Should I use Apache's mod-rewrite to change the url from myExample.ddns.net to test.myExample.com for traffic that comes from noIP.com's dynamic DNS service? – PioneerMan Aug 03 '15 at 22:51
  • @NestMan I would [change all your absolute urls](http://stackoverflow.com/q/2005079/2234742) so they are independent of the domain name. For example, you would change `http://example.com/folder/file.html` to `/folder/file.html`. – Maximillian Laumeister Aug 03 '15 at 22:54
  • That's actually how I've always had my code. Then I was using the base tag to add in either prepend 'test' or 'www' depending on the subdomain that existed in the browser's address bar. But apparently I still don't have something figured out. Yes, the CSS styling is now showing up, but all the links are broken because I haven't figured out what needs to be put into the base tag when traffic is coming from the DDNS service offered by noIP.com. Any other good suggestions? Thanks – PioneerMan Aug 04 '15 at 00:11
  • @NestMan It's weird that your site would not be working without the base tag, but try putting in your noIP url. So for instance ``. The base tag denotes the root of your site, so make it whatever it was before, but with your new domain name instead. – Maximillian Laumeister Aug 04 '15 at 00:22
  • Thanks for your help, I think I got it figured out. I removed all references to the base tag and also the code that was prepending the subdomain into the links. Now when I come in from noIP.com everything seems to be working. Thanks again! – PioneerMan Aug 04 '15 at 21:49
  • @NestMan Glad I could help! Don't forget to mark this answer as helpful and/or accepted, thanks! – Maximillian Laumeister Aug 04 '15 at 22:10