Problem embedding 2.1 in a simple web page - 404 error
I downloaded and installed Vanilla 2.1 on a ubuntu box, and all works well when vanilla is run stand-alone.
I turned on universal embedding in the dashboard, and copied/pasted the embed code into a simple page, foo.html. When I load foo.html, the javascript debug console gives a 404 file not found error. I tried the .htaccess and "RewriteUrls" suggestions at the link below, but the result is the same.
http://vanillaforums.org/discussion/25111/about-error-404-not-found
Any idea what's going on?
The error displayed in the chrome javascript console is:
http://localhost/twio/forum/vanilla/index.php?p=/js/embed.js 404 not found
My HTML page is at http://localhost/twio/forum/foo.html:
<html> <body> <div> Hi <script type="text/javascript" src="http://localhost/twio/forum/vanilla/index.php?p=/js/embed.js"></script> <noscript>Please enable JavaScript to view the <a href="http://vanillaforums.com/?ref_noscript">discussions powered by Vanilla.</a></noscript> <div class="vanilla-credit"><a class="vanilla-anchor" href="http://vanillaforums.com">Discussions by <span class="vanilla-logo">Vanilla</span></a></div> </div> </body> </html>
.htaccess in the vanilla directory has:
RewriteBase /twio/forum
And I've changed config.php to include:
$Configuration['Garden']['RewriteUrls'] = TRUE;
Comments
The RewriteBase is wrong it should be /forum
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Just tried it. Didn't fix it.
to get some reasonable help. you need to specify which folder your forum is installed in.
is your forum located in folder /twio/forum/vanilla?
because that is where you are trying to go.
you probably want to remove the "vanilla" if your forum is not located in a subfolder called vanilla.
both your js and .htaccess call depend on the correct knowledge of that location.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Oh forgot that. The forum is installed in:
/twio/forum/vanilla
and embed.js is located in:
/twio/forum/vanilla/js
that is the problem
your forum is Called Vanilla ? Or did you install it inside the a subdirectory called forum ?
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
When I unzipped vanilla, it unzipped into a directory "vanilla".
I placed the directory "vanilla" in the subdirectory "forum"
So - for example the file index.php is at http://localhost/twio/forum/vanilla/index.php
The forum is named "Test Forum"
No you install vanilla inside a forum folder that is it.
create a subdirectory called forum and add the forum files to that folder.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Still not working. I tried to just pare it down to a simple vanilla-only web directory.
I created a new installation at http://localhost/forum. This directory has the js, conf, etc. directories as well as index.php directly inside. I enabled embedding, edited .htaccess (Rewritebase /forum) and create a simple HTML script which contained the code from the dashboard.
Same result.
Has anyone tried this with 2.1 on ubuntu?
Yes I think @peregrine has
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Welcome to the community!
The JS script shouldn't be requesting the file through the dispatcher. Request the file directly:
http://localhost/twio/forum/vanilla/js/embed.js
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks @hgtonight, requesting the file directly worked. The code was generated by the vanilla dashboard "embed" panel - where do I report the bug?
Via the Issues page over on GitHub: https://github.com/vanilla/vanilla/issues
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.