I\'ve this url: http://www.test.com/page.php?k=m1ns
and I want this one: http://www.test.com/r/m1ns
My .htaccess:
Options +FollowSymlinks
Rewrite
Try this
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^r/(.*)/ /page.php?k=$1 [L]
It should work regardless of whether or not www is entered.
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^r/([^/]*)$ /page.php?k=$1 [L]
On your top page.php
if (strstr($_SERVER['REQUEST_URI'], '/page.php?k=' . $var . '')) {
header("HTTP/1.1 301 Moved Permanently");
header("location:http://www.test.com/r/" . $var );
exit();
}