iamruskie
iamruskie

Reputation: 766

How to properly redirect from old url to new with .htaccess?

Ok I recently finished cleaning up my urls. But i still have pages in google indexed under the old urls. In .htaccess i was trying something like:

    RedirectMatch permanent ^profile2.php?id=([^/]+) /profile/$1

but it doesn't seem to be working..help anyone? what am i doing wrong?

Upvotes: 0

Views: 45

Answers (1)

Clive
Clive

Reputation: 36956

You should probably use a 301 permanent redirect:

RewriteRule ^profile2.php?id=([^/]+) /profile/$1 [R=301]

Upvotes: 1

Related Questions