Note that there are some explanatory texts on larger screens.

plurals
  1. POSafari does not work with forms on .htaccess site
    text
    copied!<p>I can't get Safari to submit forms to a page that is protected by .htaccess.<br> I have reduced my test page to:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;?php if(isset($_REQUEST["name"])) echo "&lt;p&gt;You entered: ", $_REQUEST["name"], "&lt;/p&gt;"; ?&gt; &lt;form method='post' action='index.php'&gt; &lt;p&gt;&lt;input type='text' NAME='name'&gt; &lt;input type='submit' name='send' value='Send'&gt;&lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If I remove the .htaccess file the above page runs without any problem.<br> With this .htaccess file Safari will never finish loading the page:</p> <pre><code>AuthUserFile /xxxx/xxxx/.htpasswd AuthGroupFile /xxxx/xxxx/.htgroup AuthName Members AuthType Basic &lt;Limit GET POST&gt; require group XXXXX &lt;/Limit&gt; ErrorDocument 401 /errors/401.php </code></pre> <p>Is there a workaround for this problem?</p> <p><strong>Update</strong></p> <p>I can remove the POST limitation in the .htaccess file:</p> <pre><code>&lt;Limit GET&gt; require group XXXXX &lt;/Limit&gt; </code></pre> <p>This will work for the above test case, but I won't be logged in anymore which means that:</p> <ol> <li>I don't have access to <code>$_SERVER["PHP_AUTH_USER"]</code></li> <li>I have a security hole</li> </ol> <p>Any ideas?</p> <p><strong>Update 2</strong></p> <p>I have added a missing line in the .htaccess file above (<code>ErrorDocument 401 /errors/401.php</code>) and made a personal reminder to always include everything in the samples (I'm supposed to know this). Helped by the comments from <a href="https://stackoverflow.com/users/719/marie-fischer">Marie Fischer</a> it turns out that:</p> <p>Safari will not be able to submit a form to a page that is protected by <code>.htaccess</code> (which limits POST) if the <code>.htaccess</code> file includes an ErrorDocument like:</p> <pre><code>ErrorDocument 401 /errors/401.php </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload