Mister Gan
Mister Gan

Reputation: 309

Redirect php page with htaccess

My old domain address is http://www.example.com/viewtopic.php?t=123456

and then I want to redirect all these type of addresses to http://www.newdomain.com/viewtopic.php?t=123456

RewriteEngine on
RewriteBase /
RewriteRule viewtopic\.php?t=([^/]+)$ http://freeware2010.com/viewtopic.php?t=$1 

The code does not appear to work.

Upvotes: 0

Views: 228

Answers (1)

coreyward
coreyward

Reputation: 80140

You want a permanent (301) redirect. Here are a couple of tutorials on how to do it (the first being very verbose and slow-paced, so good for a beginner).

http://www.gnc-web-creations.com/301-redirect.htm

http://www.askapache.com/htaccess/301-redirect-with-mod_rewrite-or-redirectmatch.html

Upvotes: 1

Related Questions