Forum Moderators: coopster

Message Too Old, No Replies

PHP Header Redirect With 301

         

wfernley

1:38 pm on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello, :)

I recently switched my site to a new design using mod_rewrite so my pages are no longer products.php?product_id=99, instead they are now products/widget/index.html. I was curious how I could use a 301 redirect to show Search Engines that it was a permanent move. I have the old page products.php that just grabs the id and gets the sku of the product (in the case above it was "widget") and then uses a PHP Header Redirect to send them to the new page. I was curious if it is possible I can add the 301 code to the PHP Header Redirect?

Thanks in advance for your help!

Wes

wfernley

3:29 pm on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found this while searching.....

I made my headers look like this:
header("HTTP/1.1 301 Moved Permanently");
header("Location: [mysite.com...]

We will see if this works.

If anyone has any other ideas let me know :)

Wes