3

Ok, so I have this .htaccess file that contains this

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php?p=%{REQUEST_URI}&%{QUERY_STRING} [L]
</IfModule>

Problem is, that in apache 2.2.22, the p and the other query objects don't come through, but it works great in apache 2.4.2 .

So basically in apache 2.2.22 it just forwards everything to index.php, but it doesn't have any get objects.

Any help, thanks.

Update

Ok so I changed the line

RewriteRule . /index.php?p=%{REQUEST_URI}&%{QUERY_STRING} [L]

to

RewriteRule ^(.*) /index.php?p=$1 [L,QSA] And now on apache 2.2.22 the p GET doesn't go through, but any specific queries I add go through.

So If I do

http://localhost/index/fun/buns/funds?man=woman

on 2.4.2 I get

array (size=2)
  'p' => string 'index/fun/buns/funds' (length=20)
  'man' => string 'woman' (length=5)

and on 2.2.22 I get

array(1) {
  ["man"]=>
  string(5) "woman"
}

To be clear What's happening on 2.4.2 is what I want, and 2.2.22 isn't cooperating.

Another Update Ok so it seems like what is happening is that when I do /index/whatever, it auto assumes index.php, and ignores that, it auto adds the .php to it, when I don't want it to. Any ideas on how to stop that?

1 Answer 1

3

Needed to put add -MultiViews to the httpd.conf file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .