Question:

PHP redirection loop error?

by  |  earlier

0 LIKES UnLike

I want to redirect http://www.dl-share.co.uk, i am doing this by applying the following PHP code to my index file :

<?php

header( "HTTP/1.1 301 Moved Permanently" );

header( "Status: 301 Moved Permanently" );

header( "Location: http://www.dl-share.co.uk/" );

exit(0);

?>

But when i type in http://dl-share.co.uk for it to redirect, i get a redirect loop error and says request can never be completed !

Can anyone help me?

 Tags:

   Report

3 ANSWERS


  1. Your dns is probably pointing to the same IP address for both URLs. It needs to be set either to point to the machine by domain, or by host. It can do both, but then this re-direct can NEVER work.


  2. Well, the other day you wanted to redirect to a different directory using DNS,, now you want to do what SHOULD BE A DNS entry to redirect a domain!  

    USE DNS a CNAME entry will fix this without using PHP which is designed for a different type of redirect!  (Site redirects are better with DNS. Directory redirects should use the php etc.)

    First the DNS A record should be

    dl-share.co.uk.  IN A 123.123.123.123 (this is your IP)

    Second a Cname entry

    www   IN CNAME  dl-share.co.uk.

    That way either one works and points to the same place in the server! Then your visitors can use either entry to get to the same place.

  3. Data Recovery-

    http://flinchumonline.com/

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions