jing.ling Posted April 27, 2009 Share Posted April 27, 2009 Hi all I just created a php file which is used to 301 redirect to another page. The code wrote is: <?php // Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.google.com/"); exit(); ?> But when I check it online with http://www.best-seo-tools.net/301check/Default.aspx, it shows a 302 redirect inseatd of 301 Can anyone help me about that? Thanks Link to comment https://forums.phpfreaks.com/topic/155771-301-redirect-in-php/ Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 Try using .htaccess instead. Google .htaccess 301 redirect for more information on it. Link to comment https://forums.phpfreaks.com/topic/155771-301-redirect-in-php/#findComment-819990 Share on other sites More sharing options...
jing.ling Posted April 27, 2009 Author Share Posted April 27, 2009 Try using .htaccess instead. Google .htaccess 301 redirect for more information on it. Hi, thanks for reply but I am using IIS server so .htaccess may not be suitable for me. Link to comment https://forums.phpfreaks.com/topic/155771-301-redirect-in-php/#findComment-820003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.