October 28, 2005 in Feedback
I was trying to create a main page for my site using the IPB wrapper and skins, but right away ran in to a problem with many URLs being relative to the IPB root, and therefor not working outside of it
So basically, if your forums are forums.domain.com, and want to use www.domain.com as your main site, using the IPB skins is kind of a problem.
Just as good design practice, shouldn't the URLs all be fully qualified to begin with anyway?
I'm not sure what you mean here. I do that and I don't have any issues with my skins at all.
relative is better, it makes the forum as a whole more portable.
um, doesn't it make it less portable?
If your forums arehttp://forums.domain.com
so your jscript for example is inhttp://forums.domain.com/jscripts
If you are making a page onhttp://www.domain.com
the relative links to
don't work becuase they aren't where the browser things they are.http://forums.domain.com/jscripts/whatever.js should obviously be a lot better...
Relative urls aren't too useful for users like yourself trying to use the css outside of IPB, however, it is more optimized from what I have read, in that it causes the server to look for the images locally to serve, instead of making an http request to pull the images.
i.e. if you look in your apache access logs, if you have full urls for the images you'll see a request for each image on your board just for one page load. That could be what 30 http requests to your server for one page load. With relative paths for the images, you get one request (the actual user requesting the page). :)
OH! I see what you mean with the shared code :) I have shared css and other code across 5 subdomains with the code stored on the main WWW.
Redirect /includes http://www.domain.com/includes
Redirect /code http://www.domain.com/code
It's not the best way, but it gets it done. My CSS is in code and my template files for the wrapper page is in includes.
In your case, have the .htaccess on your WWW root and put in Redirect /jscript http://forums.domain.com/jscript and that should work :) Or, you know, hard code it on the WWW side.
Yeah, the workaround you posted is actually pretty smooth work. Should get the job done. :D
Another thing about the relative urls that bugs me a little (trade-offs, eh) is that if you mod IPB to display error pages (using .htaccess to set the ErrorDocuments to something in IPB), if it's like /some/invalid/path of course the images won't show then either. >.<
I had actually just used a str_replace to change the jscripts and image links to use the full URL, but the htaccess way is a heck of a lot better, I'll change it to that way later.
The reasoning makes perfect sense too bfarber, hadn't thought of it (not that it ever would have occured to me anyway, lol)
This topic is now archived and is closed to further replies.
Started 33 minutes ago
Started 3 hours ago
Started November 25