hi all, I need to redirect this url(when client enters it): www.site.com/index.php?option=com_facileforms&Itemid=499 to the different page on different site: my Rewrite rule is: RewriteEngine On RedirectMatch 301 ^index.php?option=com_facileforms&Itemid=$1$ http://www.yxz.com/mypage.php unfortunately it doest work guys, any ideas how to create a rule for my situation?
Try something like this: RewriteRule ^(.*)index.php\?option=com_facileforms&Itemid=499$ http://www.yxz.com/mypage.php [R=301,L]
Its hard to say what is going on on your server without looking at ErrorLog. May be you can post here what errors do you get.
RewriteRule doesn't look at the querystring (everything after "?") when seeing if there's a match. It only looks at the URI ("/path/to/file.html") You need to setup RewriteRule to match a URI, which in your case will be "index\.php$" and then you need to use RewriteCond to match the querystring.
You're not interpreting the manual correctly Tom. I'm telling you from experience, mod_rewrite splits the URI and QUERY_STRING apart before applying the pattern from RewriteRule. Here, look. This is generated with RewriteLogLevel set to 9, the most verbose.
Yes you are right. I got confused by a lot of examples where (.*) was used whether it was necessary or not. [R] tells it to rewrite whole URL.
I used to get confused about the same thing when I started with mod_rewrite. I definitely don't remember it seeming very straight forward in the beginning, there was a lot of "I before E except after C" type rules about it.