I’ve got a problem with redirecting some page(s). My rewrite rule looks like that (example):
RewriteRule /index.php?option=com_content&view=article&id=47:article-keyword&catid=8:position$ article-keyword.html [R=301,L]
But it’s not working, i was trying some different combinations but it still doing nothing.
Any solution?
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:
This should redirect
/index.php?option=com_content&view=article&id=47:article-keyword&catid=8:positiontoarticle-keyword.htmlThe
^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
RewriteCondand the%QUERY_STRINGvariable.Success! The following worked for me!
This redirected
http://site.domain.com/index.php?option=com_content&view=article&id=47:article-keyword&catid=8:positiontohttp://site.domain.com/article-keyword.htmlThis only redirects requests to index.php that have the query string in question.