How to redirect old links to new SEO friendly links?
<p>I just started developing web sites. I know that this question has been asked many times. Although, I checked most of them, I could not manage to redirect old links to new SEO friendly links.
mysite.com/search.php?word=thanks and mysite.com/thanks boths works. When form is submtited, site runs the old link. I have been trying to solve this problem and searching web for hours. I have added this code at the bottom of the .htdocs file but didn't work.</p>

<pre><code>RewriteRule search.php?word=^(.*)$ $1 [R=301,L]
</code></pre>

<p>Here is my .htdocs codes</p>

<pre><code>RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule .* - [F]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ search.php?word=$1 [QSA,L]
</code></pre>

<p>Thanks</p>