How to create search engine friendly redirects?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abbbbi
Forum Newbie
Posts: 1
Joined: Thu May 21, 2009 8:15 pm

How to create search engine friendly redirects?

Post by abbbbi »

I've been trying to accomplish the same type of thing. I did a similar method as you:

Code: Select all

if(preg_match("/page\?question=(.+)&submit=Confirm/", $_SERVER['REQUEST_URI'], $match))
{ 
    header('Location: http://example.com/page/'.$match[1]); 
}
Unfortunately that isn't the proper way as it causes a 302 redirect. I would like my site to be search engine friendly, so a 302 redirect will cause problems. If you happen to figure out how to do this properly, please post how. :)

Gonna try it your way and check the headers.
Last edited by Benjamin on Thu May 21, 2009 8:23 pm, edited 2 times in total.
Reason: Changed code type from text to php.
webnhance
Forum Newbie
Posts: 5
Joined: Tue Feb 10, 2009 6:23 pm

Re: How to create search engine friendly redirects?

Post by webnhance »

Try this page here, helped me accomplish the same goal.

http://www.webconfs.com/url-rewriting-tool.php
Post Reply