httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Wigg <p...@philipwigg.co.uk>
Subject Re: [users@httpd] RewriteRule help please
Date Mon, 23 Nov 2009 11:32:29 GMT
> I have the following rewrite rule ..
>
> RewriteRule products/specials(.*)(.*)
> /products/index.php?view=specials&$1=$2 [L]
>
> http://www.mysite.com/products/specials&filter=20
> --> http://www.mysite.com/products/index.php?view=specials&filter=20=
>
> The problem is the trailing '='
>
> I have also tried RewriteRule wheels/specials([0-9]+)
> /wheels/index.php?view=specials&$1 [L]
> but this rule results in internal server errors.

One problem in your first rule is that the '(.*)(.*)' part. (.*)(.*)
is functionally equivalent to just a single (.*), so your $2 will
always be empty (this is causing the trailing =). Maybe just try:-

RewriteRule products/specials(.*) /products/index.php?view=specials&$1 [L]

If that's not what you're after, I think I'd need a couple of examples
of the URL you're trying to rewrite and what you're expecting it to be
rewritten to, as I don't completely understand it at the moment.

Cheers,
Phil.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message