kastermester
kastermester

Reputation: 3064

Mod rewrite issue

As many others I am having issues with doing some very simple mod_rewriting in apache.

I have the following in my .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^view/([0-9]+)/([0-9]+)$ view.php?advertId=$1&publisherId=$2 [NC,QSA,L]

Which is supposed to translate /view/4093/203?qs=val -> /view.php?advertId=4093&publisherId=203?qs=val

Now, it works when calling it with /View..., but when doing lowercase /view, it redirects to the right file, but advertId and publisherId is not set within my PHP script as it is with the first-letter-uppercase View and I simply put have no clue whatsoever with what is going on on that front (I have been testing and watching that behavior simply by doing a on my view.php).

Anyone know why this is happening?

I may want to add, my server info is as follows:

Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny2 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_perl/2.0.4 Perl/v5.10.0 

IE. a stock brand new debian install with default debian packages + php-mssql.

Upvotes: 6

Views: 2077

Answers (1)

Gumbo
Gumbo

Reputation: 655785

MultiViews might cause this behavior, that is trying to map the request to a siminar existing file before passing the request to mod_rewrite. Try to disable it:

Options -MultiViews

Upvotes: 10

Related Questions