HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

web.config no longer working with Vanilla 2021.009 on fresh install, via IIS10

selfawareselfaware New
edited May 13 in Vanilla 3.x Help

Hi,

Installed Vanilla 2021.0009, however am unable create discussions and noticed that the included discussions lost their formatting - I'm pretty sure it's a web.config issue. Everything else, seems to work!

I used the following with Vanilla 3.3 and had no issues:

2021.009 is operating in my root director and can be viewed at www.badpolicy.com

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
   <rewrite>
     <rules>
       <clear />
       <rule name="Vanilla Rule 1" stopProcessing="true">
         <match url="^(.*)$" ignoreCase="false" />
         <conditions logicalGrouping="MatchAll">
           <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
           <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
         </conditions>
         <action type="Rewrite" url="index.php\?p={R:1}" appendQueryString="true" />
       </rule>
     </rules>
   </rewrite>
 </system.webServer>
</configuration>


When I click on new discussion, vanilla redirects to the

following url:

http://www.badpolicy.com/index.php?p=/post/discussion

and I get: Something has gone wrong.

Comments

  • KasparKaspar Moderator
    edited May 13

    I have edited your post to add code-block around the config


    Have you enabled pretty urls in config.php aswell?

    Enabling pretty urls to get that index.php?p= away

    https://open.vanillaforums.com/discussion/comment/220157/#Comment_220157

    https://open.vanillaforums.com/discussion/27568/enabling-clean-urls-on-iis-installations#latest

  • KasparKaspar Moderator

    It think ppl some deeper understanding on this will ask for content of your htaccess and debug info https://open.vanillaforums.com/discussion/comment/219008/#Comment_219008 in order to help

  • selfawareselfaware New
    edited May 13

    Thanks, I'll make sure to use code block in the future.

    I added:

    $Configuration['Garden']['RewriteUrls'] = TRUE;

    under the garden header, but no dice.

    Hopefully, there are some IIS experts out there, schooled in web.config syntax.

    I was thinking, since Vanilla asks if you are using htaccess or not, if you answer, "no" perhaps it could auto generate a web.config file, similar to what wordpress does.

  • selfawareselfaware New
    edited May 14

    Update:

    I notice if I turn off the Rich editor, all problems disappear?

    However, with the Rich editor on, I get the following errors:

    Fatal Error in Smarty_Security._checkDir();

    Smarty Security: not trusted file path 'D:\www\badpolicy.com\plugins\rich-editor\views\rich-editor.tpl'

    The error occurred on or near: D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_security.php

    657:                 $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', DIRECTORY_SEPARATOR, $directory);
    658:             }
    659:         }
    660:         // give up
    661:         throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ', $filepath));
    662:     }
    663: 
    664:     /**
    665:      * Loads security class and enables security
    

    Backtrace:

    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_security.php:545] Smarty_Security->_checkDir();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_internal_resource_file.php:33] Smarty_Security->isTrustedResourceDir();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_template_source.php:182] Smarty_Internal_Resource_File->populate();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_internal_template.php:168] Smarty_Template_Source::load();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\Smarty.class.php:1028] Smarty_Internal_Template->__construct();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_internal_templatebase.php:189] Smarty->createTemplate();
    [D:\www\badpolicy.com\vendor\smarty\smarty\libs\sysplugins\smarty_internal_templatebase.php:134] Smarty_Internal_TemplateBase->_execute();
    [D:\www\badpolicy.com\library\core\class.smarty.php:146] Smarty_Internal_TemplateBase->display();
    [D:\www\badpolicy.com\library\core\class.controller.php:890] Gdn_Smarty->render();
    [D:\www\badpolicy.com\plugins\rich-editor\RichEditorPlugin.php:113] Gdn_Controller->fetchView();
    [D:\www\badpolicy.com\plugins\rich-editor\RichEditorPlugin.php:113] RichEditorPlugin->gdn_form_beforeBodyBox_handler();
    [D:\www\badpolicy.com\library\Garden\EventManager.php:282] PHP::call_user_func_array();
    [D:\www\badpolicy.com\library\core\class.pluginmanager.php:812] Garden\EventManager->fire();
    [D:\www\badpolicy.com\library\core\class.pluginmanager.php:770] Gdn_PluginManager->callEventHandler();
    [D:\www\badpolicy.com\library\core\class.pluggable.php:137] Gdn_PluginManager->callEventHandlers();
    [D:\www\badpolicy.com\library\core\class.form.php:310] Gdn_Pluggable->fireEvent();
    [D:\www\badpolicy.com\applications\vanilla\views\post\discussion.php:63] Gdn_Form->bodyBox();
    [D:\www\badpolicy.com\library\core\class.controller.php:887] PHP::include();
    [D:\www\badpolicy.com\library\core\class.controller.php:1508] Gdn_Controller->fetchView();
    [D:\www\badpolicy.com\library\core\class.pluggable.php:217] Gdn_Controller->xRender();
    [D:\www\badpolicy.com\applications\vanilla\controllers\class.postcontroller.php:418] Gdn_Pluggable->__call();
    [D:\www\badpolicy.com\library\core\class.dispatcher.php:933] PostController->discussion();
    [D:\www\badpolicy.com\library\core\class.dispatcher.php:335] Gdn_Dispatcher->dispatchController();
    [D:\www\badpolicy.com\index.php:29] Gdn_Dispatcher->dispatch();
    


  • KasparKaspar Moderator

    Rich editor require pretty URLs.

Sign In or Register to comment.