Jump to content

PHP 301 Redirect Help


monkeybidz

Recommended Posts

I am using a 301 redirect in php and it works fine when using the web, but when you try to view through a mobil phone or other device, it does not follow the redirection.

 

<?php
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: http://www.mysite.com/otherfolder/index.php"); 
exit(); 
?>

Link to comment
https://forums.phpfreaks.com/topic/79764-php-301-redirect-help/
Share on other sites

This is a bad method of doing redirects. What i would do is a .htaccess file with a redirect. this the server parses before showing the page. and therefore you would not need to worry about  a phone with ridirects disabled.

example:

 

Redirect 301 /oldpage.html http://www.example.com/newpage.html

Link to comment
https://forums.phpfreaks.com/topic/79764-php-301-redirect-help/#findComment-403947
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.