http://subdomain.domain.co.uk/index.php?string=surname i'm trying to redirect the above page to subdomain.domain.co.uk/surname in index.php I have the following links to reload the page with new data <a href="index.php?string=surname" title="title">surname</a> <a href="index.php?string=surname2" title="title">surname2</a> I've tried the following in my htaccess Options +FollowSymLinks RewriteEngine on RewriteRule ^/(.*)/$ /index.php?$1 but it doesn't make any difference to the displayed url, or the url in index.php Please can someone help?!
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^index.php?string=(.*)$ http://www.domain.com/$1/ [R=301,L] Though it might do an infinite loop. Links should be changed to static before search engines find them.
Thanks Nintendo I think i'm slowly understanding it now... the links in my php page should coded like like this... <a href="http://subdomain.domain.co.uk/surname.html">surname</a> and in the htaccess, my rewrite code should be like this... Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^index.php?string=(.*)$ http://subdomain.domain.co.uk/$1.html Nearly understanding it! I hope that's right?
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^([^.]+)\.html$ index.php?string=$1 [L]