Update: The RewriteRule below is incorrect. See update for 7/9/2012 for more details
I have read that RewriteRules are always relative, therefore try:
RewriteRule ^index\.php\?option=com_content&view=article&id=47:article-keyword&catid=8:position$ article-keyword.html [R=301,L]`
This should redirect /index.php?option=com_content&view=article&id=47:article-keyword&catid=8:position
to article-keyword.html
The ^
designates the beginning of the string. Please take a look at http://www.noupe.com/php/10-mod_rewrite-rules-you-should-know.html for more information on Apache's RewriteRule.
Update - 2012-07-08
Ok, after reading the Apache documentation, the RewriteRule DOES NOT match on the query string. To match on data within the query string you need to use a RewriteCond
and the %QUERY_STRING
variable.
Success! The following worked for me!
RewriteCond %{QUERY_STRING} option=com_content&view=article&id=47:article-keyword&catid=8:position
RewriteRule ^index\.php$ article-keyword.html? [R=301,L]
This redirected http://site.domain.com/index.php?option=com_content&view=article&id=47:article-keyword&catid=8:position
to http://site.domain.com/article-keyword.html
This only redirects requests to index.php that have the query string in question.