think tank forum

technology » MultiViews VERSUS RewriteRule

lucas's avatar
17 years ago
link
lucas
i ❤ demo
multiviews win.

this simple fact has enraged me for weeks, now. but now i know!

example

i have a file called journal.php, which accepts a variable id. the contents of .htaccess in the same directory were to the effect of:

RewriteEngine On
RewriteRule ^journal/(.*)$ journal.php?id=$1



then i visit /journal/1234 in my browser. guess what happens! the variable isn't passed to journal.php. know why? because apache skipped the rewrite rule and looked for a multiview match (journal*) and it found journal.php.

so, before anything else in your .htaccess, specify:

Options -Multiviews



sigh.
lucas's avatar
17 years ago
r1, link
lucas
i ❤ demo
this post has been archived.
lucas's avatar
17 years ago
link
lucas
i ❤ demo
references (now that i know it is multiview's fault and know what to search google for):
http://mudry.org/blog/post/2007/01/19/Incompa … ewriteRule
http://www.gerd-riesselmann.net/archives/2005 … multiviews
lucas's avatar
17 years ago
link
lucas
i ❤ demo
got it working...

http://www.wingedleopard.net/lucas/journal/124