liber77 Posted December 3, 2011 Share Posted December 3, 2011 I have tried to make a redirect like this: redir.php?page=http://****.com <?php if(is_file($_GET['page'])){$page = $_GET['page'];} else{$page = "DEFAULT.php";} header("Location: ".$page); ?> But I only get: Forbidden You don't have permission to access /redir.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. What should I do? Could it have something to do with encoding of special characters? Ordinary php scripts like <?php echo "Hello"; ?> Works fine. Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/ Share on other sites More sharing options...
scootstah Posted December 4, 2011 Share Posted December 4, 2011 Have you tried it without the http:// in the url? Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/#findComment-1294141 Share on other sites More sharing options...
btellez Posted December 4, 2011 Share Posted December 4, 2011 The redir.php script works fine for me on my local php installation. Are there any odd .htaccess rules or anything of that sort that may be affecting the way your routing is getting handled? Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/#findComment-1294205 Share on other sites More sharing options...
liber77 Posted December 6, 2011 Author Share Posted December 6, 2011 I just don't know. I am using hostgator. I don't understand the problem. Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/#findComment-1294955 Share on other sites More sharing options...
ialsoagree Posted December 6, 2011 Share Posted December 6, 2011 What are the permissions on redir.php on the file server? Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/#findComment-1294956 Share on other sites More sharing options...
Adam Posted December 6, 2011 Share Posted December 6, 2011 You don't have permission to access /redir.php on this server. Likely a permissions issue. Using your FTP client or through SSH, set the permissions to 755. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. This just means you're trying to use a custom 404 error page that doesn't exist itself. Link to comment https://forums.phpfreaks.com/topic/252409-how-to-do-redirphppagehttpcom/#findComment-1294968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.