Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • offroadmagazin Friend
    #168856

    Hi,

    When I have URL Rewriting ON, the captcha image in JA Comment doesn’t appear (the link seems to be broken).

    My system:
    Microsoft-IIS/7.5
    Joomla 1.7.0,
    JA Teline IV 1.1.1, JA Comment 1.0.3 (for J1.6)

    This is an example page: (I have rewriting ON at the moment, and Captcha ON, which I will change eventually, because commenting is not possible now):
    http://offroadmagazin.hu/off-road/off-road-hirek/bacs-trophy-kupa/746-bacs-trophy-bajnoksag-v-futam

    I cleared the cache both server and client side (I pressed “JAT3 Clear Cache”, and deleted the cache at Website management-Clear cache, I even deleted all the files at the /cache directory), the problem persists.

    Should I try to upgrade to JA Comment 1.1.0 (for J1.7)?
    Anything else I could try to change, or could you look into this, please?

    Regards,
    Arpad

    offroadmagazin Friend
    #414443

    Comment posting is also unsuccessful, on the Javascript console, I find this, after I press the submit button:

    Failed to load resource: http://offroadmagazin.hu/component/jacomment/?option=com_jacomment&view=comments&task=addnewcomment&tmpl=component&contentoption=com_content&contentid=754&commenttype=1
    the server responded with a status of 404 (Not Found)

    I’m not so versatile in the field of url rewriting, so any pointing to the right direction is welcome.

    offroadmagazin Friend
    #414828

    I’m trying to narrow this issue down. It must be somehow related to IIS server’s rewriting, because

    1st Experiment
    The online version: URL Rewriting is on, and web.config is there.
    Result: comments DON’T WORK, no image, no commenting, check screenshot:

    http://www.offroadmagazin.hu/off-road/off-road-hirek/bacs-trophy-kupa/751-videok-kiskunhalasrol
    The html of the captcha image is the following:
    <img alt=”Captcha Image” title=”Kattints a kód frissítéséhez” onmousemove=”actionjacLoadNewCaptcha(‘show’)” onmouseout=”actionjacLoadNewCaptcha()” onclick=”jacLoadNewCaptcha(0)” id=”jac_image_captcha” src=”/component/jacomment/?task=displaycaptchaaddnew&tmpl=component”>

    2nd Experiment
    I’ve created a test version from the Akeeba backup of the online version.
    In this test version, I switched off URL rewriting (so being placed into a subdirectory won’t matter), and deleted web.config file.

    Result: comments WORK – image appears, commenting is possible, check screenshot:

    http://offroadmagazin.hu/telepites/teszt/index.php/off-road/off-road-hirek/bacs-trophy-kupa/751-videok-kiskunhalasrol

    The html of the captcha image is the following:
    <img alt=”Captcha Image” title=”Kattints a kód frissítéséhez” onmousemove=”actionjacLoadNewCaptcha(‘show’)” onmouseout=”actionjacLoadNewCaptcha()” onclick=”jacLoadNewCaptcha(0)” id=”jac_image_captcha” src=”/telepites/teszt/index.php/component/jacomment/?task=displaycaptchaaddnew&tmpl=component”>

    3rd Experiment
    I’ve created a version on localhost from the same backup, on Apache server, and it WORKS with url rewriting on, check screenshot:

    http://localhost/off-road/off-road-hirek/bacs-trophy-kupa/751-videok-kiskunhalasrol
    <img alt=”Captcha Image” title=”Kattints a kód frissítéséhez” onmousemove=”actionjacLoadNewCaptcha(‘show’)” onmouseout=”actionjacLoadNewCaptcha()” onclick=”jacLoadNewCaptcha(0)” id=”jac_image_captcha” src=”/component/jacomment/?task=displaycaptchaaddnew&tmpl=component”>

    I wonder, whether there’s something wrong with the web.config file. I use the one from Joomla 1.7, unmodified:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
    <match url="^(.*)$" ignoreCase="false" />
    <conditions logicalGrouping="MatchAny">
    <add input="{QUERY_STRING}" pattern="base64_encode[^(]*([^)]*)" ignoreCase="false" />
    <add input="{QUERY_STRING}" pattern="(>|%3C)([^s]*s)+cript.*(<|%3E)" />
    <add input="{QUERY_STRING}" pattern="GLOBALS(=|{0,2})" ignoreCase="false" />
    <add input="{QUERY_STRING}" pattern="_REQUEST(=|{0,2})" ignoreCase="false" />
    </conditions>
    <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
    </rule>
    <rule name="Imported Rule 2">
    <match url="(.*)" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    <add input="{URL}" pattern="^/index.php" ignoreCase="true" negate="true" />
    <add input="{URL}" pattern="(/component/)" ignoreCase="false" negate="true" />
    <add input="{URL}" pattern="(/[^.]*|.(php|html?|feed|pdf|raw))$" />
    </conditions>
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>


    1. test_without_rewrite_ok
    2. online_with_rewrite_not_ok
    3. localhost_with_rewrite_ok
    offroadmagazin Friend
    #415003

    Solved!

    I’ve created my own web.config file, and the issue is gone. I’ve translated the rules of the .htaccess file with IIS Manager, then I made some modifications, and I ended up with this file below. Please note, that I’m not an expert in rewriting rules, so check it twice before you use it. And if you find something bad (I screwed up security or something), or you may want to thank me, please drop me a note to szaboaz AT freemail DOT hu.

    Regards,
    Arpad

    Ps. I’m a little bit disappointed in joomlart support. Not a note? Seriously? And noone ever tried JA Comment on an IIS server, for real?

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <!--# Return 403 Forbidden header and show the content of the root homepage-->
    <rule name="Security Rule" stopProcessing="true">
    <match url=".*" ignoreCase="false" />
    <conditions logicalGrouping="MatchAny">
    <!--# Block out any script trying to base64_encode data within the URL.-->
    <add input="{QUERY_STRING}" pattern="base64_encode[^(]*([^)]*)" ignoreCase="false" />
    <!--# Block out any script that includes a <script> tag in URL.-->
    <add input="{QUERY_STRING}" pattern="(<|%3C)([^s]*s)+cript.*(>|%3E)" />
    <!--# Block out any script trying to set a PHP GLOBALS variable via URL.-->
    <add input="{QUERY_STRING}" pattern="GLOBALS(=|{0,2})" ignoreCase="false" />
    <!--# Block out any script trying to modify a _REQUEST variable via URL.-->
    <add input="{QUERY_STRING}" pattern="_REQUEST(=|{0,2})" ignoreCase="false" />
    </conditions>
    <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
    </rule>

    <!--# internally rewrite the request to the index.php script-->
    <rule name="SEO Rule">
    <match url=".*" ignoreCase="false" />
    <conditions>
    <!--# If the requested path and file is not /index.php and the request-->
    <!--# has not already been internally rewritten to the index.php script-->
    <add input="{URL}" pattern="^/index.php" ignoreCase="false" negate="true" />
    <!--# and the request is for something within the component folder,-->
    <!--# or for the site root, or for an extensionless URL, or the-->
    <!--# requested URL ends with one of the listed extensions-->
    <add input="{URL}" pattern="/component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$" />
    <!--# and the requested path and file doesn't directly match a physical file-->
    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
    <!--# and the requested path and file doesn't directly match a physical folder-->
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 1 voice, and was last updated by  offroadmagazin 13 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum