Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try adding a <code>/</code> in front of it, and a <code>$</code> at the end.<br> Like:</p> <pre><code>RewriteRule ^/(.*)$ cgi-bin/router.py?request=$1 [NC] </code></pre> <p>Also, I find it best to use the <code>RewriteBase</code> directive when testing. Then you can just alter that instead of having to mess with the regular-expressions themselves.</p> <pre><code>RewriteBase /test/ RewriteRule ^(.*)$ cgi-bin/router.py?request=$1 [NC] </code></pre> <p>And, when moved to the real-world:</p> <pre><code>RewriteBase / RewriteRule ^(.*)$ cgi-bin/router.py?request=$1 [NC] </code></pre> <p><strong>Edit</strong><br> After some more testing, I found that the problem is perhaps not with the expression itself, but rather with your directory name: <code>cgi-bin/</code>. Apache, by default, uses this directory for CGI scripts, but uses <code>ScriptAlias</code> to redirect requests for <code>/cgi-bin/*</code> to another directory. In my case a directory named the same in the Apache installation directory.</p> <p>Is this a directory you created yourself, or are you using the directory Apache has aliased this to?<br> You have to either </p> <ol> <li>Use the directory Apache specifies in the configuration</li> <li>Edit the configuration to allow you to specified this yourself, or</li> <li>Choose another directory name.</li> </ol> <p>Personally, I would go with #3. I tried this, and it worked fine for me.</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !bin/ RewriteRule ^(.+) bin/request.php?ctrl=$1 [NC,L] &lt;/IfModule&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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