miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Setting custom paths to JS/CSS files in header properly, when having Keyword-Rich URLs add-on installed

 
Author Paul
Lead Developer 
#1 | Posted: 1 Jun 2021 21:38 
As you may note, miniBB has the Keyword-Rich URLs add-on currently providing 3 different modes of how a forum URL could be displayed. Modes #2 and #3 (resp., the modules addon_mod_rewrite_2.php and addon_mod_rewrite_3.php) set up the structure of virtual folders. MiniBB support forums use the module #2; and for example, when entering this forum, you see its URL like:

https://www.minibb.com/forums/custom-12/

«custom-12» is purely virtual, not a physical folder, it doesn't exist.

If you have a custom header or any HTML code, which makes JavaScript or CSS references to your root website having such virtual folders present, make sure it always uses the direct URL incl. the full domain and all proper paths.

For example, putting this in the header template is wrong:

<script src="javascript/load.js"></script>
In this case, the browser would try to locate the script under https://www.minibb.com/forums/custom-12/javascript/load.js — where it's surely not present.

Putting this is a bit more reliable approach:

<script src="/javascript/load.js"></script>
Note there's put a leading slash. In this case, the script would try to find the script under the root domain, i.e. https://www.minibb.com/javascript/load.js — and most likely it would be read from there, if it's truly present in the root folder.

And finally, this is the most reliable method:

<script src="https://www.minibb.com/javascript/load.js"></script>
Having full URL present in the reference, you could avoid any problems coming up with virtual folders.

Please note: all examples in this explanation are for learning purposes only. javasript/load.js is nowhere present on miniBB domain.

Steve from LightIllusion helped me to make this topic notable to others. Thanks, Steve.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Setting custom paths to JS/CSS files in header properly, when having Keyword-Rich URLs add-on installed
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑