Note that there are some explanatory texts on larger screens.

plurals
  1. POMod_Rewrite inside directory not matching correctly
    text
    copied!<p>So I've got a root folder with this as it's .htaccess (it's a WordPress build):</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] &lt;/IfModule&gt; </code></pre> <p>and I've got a subdirectory called safetytraining-2 inside it. Requests to the sub directory work fine, and I've got a file in safetytraining-2 called true.php and it's contents are this:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;?php var_dump($_GET); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now inside safetytraining-2, I've got a .htaccess that I'm trying to test mod_rewrite with. Here's it's contents:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine on RewriteCond %{THE_REQUEST} ^true\.php(.*)$ RewriteRule ^true\.php(.*)$ - [L] RewriteRule ^(.*)$ true.php?p=$1 [L] &lt;/IfModule&gt; </code></pre> <p>Now here's the problem. When I go to website.com/safetytraining-2/foobar I get this for output:</p> <pre><code>array(1) { ["p"]=&gt; string(8) "true.php" } </code></pre> <p>It's really confusing the crap out of me. I put in the first rule with the condition to try and stop apache from recursively applying the rewrite rule, but I'm guessing it didn't help. No matter what I put after /safetytraining/, I keep getting this output. Any help here guys? You can view the page at athanclark.com/safetytraining-2. Any help would be awesome!!</p>
 

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