Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Update: The RewriteRule below is incorrect. See update for 7/9/2012 for more details</strong></p> <p>I have read that RewriteRules are always relative, therefore try:</p> <pre><code>RewriteRule ^index\.php\?option=com_content&amp;view=article&amp;id=47:article-keyword&amp;catid=8:position$ article-keyword.html [R=301,L]` </code></pre> <p>This should redirect <code>/index.php?option=com_content&amp;view=article&amp;id=47:article-keyword&amp;catid=8:position</code> to <code>article-keyword.html</code></p> <p>The <code>^</code> designates the beginning of the string. Please take a look at <a href="http://www.noupe.com/php/10-mod_rewrite-rules-you-should-know.html" rel="nofollow">http://www.noupe.com/php/10-mod_rewrite-rules-you-should-know.html</a> for more information on Apache's RewriteRule.</p> <p><strong>Update - 2012-07-08</strong></p> <p>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 <code>RewriteCond</code> and the <code>%QUERY_STRING</code> variable.</p> <p><strong>Success! The following worked for me!</strong></p> <pre><code>RewriteCond %{QUERY_STRING} option=com_content&amp;view=article&amp;id=47:article-keyword&amp;catid=8:position RewriteRule ^index\.php$ article-keyword.html? [R=301,L] </code></pre> <p>This redirected <code>http://site.domain.com/index.php?option=com_content&amp;view=article&amp;id=47:article-keyword&amp;catid=8:position</code> to <code>http://site.domain.com/article-keyword.html</code></p> <p>This only redirects requests to index.php that have the query string in question.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload