redirection code where would it be?

Discussion in 'Web Design and Development' started by markgodley, Oct 31, 2009.

  1. markgodley macrumors regular

    Mar 25, 2009

    A friend of mine had a website build. He restricted it so only customers inside france could order. So if customers came from UK or USA etc they would get re-directed to google (so it looked like the site wasnt working).

    But now google adwords have removed his add because they say customers from all over the world must be able to see the site.

    Where would the code be that controls this re-direction?

    I've looked in the htaccess but not there..also through the index.php file and cannot see anything...

    any ideas where this would be contained?
  2. angelwatt Moderator emeritus


    Aug 16, 2005
    The most common is the .htaccess file, and remember it could be in more than just the root folder, though would be in the folder where the redirection is happening or a higher folder from that point. If there was access to the httpd.conf file, it could have also been placed there.

    Another place could be in a PHP file, where it may do a IP lookup to get the geographical location of the visitor. There's also a meta tag in HTML for redirection, but I've never seen it used in conjunction with detecting the visitor's location. So the mostly likely location would be perhaps something you missed in the .htaccess file or maybe there's another file included into the index.php file. I suppose maybe the web host has a capability to add something too so you may want to look around any web panel they have.
  3. Consultant macrumors G5


    Jun 27, 2007
    Limiting number of customers isn't the best way to conduct business.
  4. BertyBoy macrumors 6502

    Feb 1, 2009
    You say you've looked in the index.php, but it would need to be in every single page, to stop a non-frenchy going straight to that other page.

    Your second bashing is, like already said, just redirecting to google, probably contravenes some law. It certainly gets you a zero-rank from google, presenting users with a page which is different from that indexed by google. And leaving your foreign customers in the dark as to WHY they've been re-directed is a good enough reason for every other search engine to zero-rank your friends site.

    But to help you, if it's in the PHP, it's going to be in the very top of the page, maybe hidden in an include or include_once. It must appear before any HTML output, and before any blank lines on the HTML output. You're looking for the PHP Header() function, which may be performing a:

    header( "Location:");
  5. Dal123 macrumors 6502a


    Oct 23, 2008
    Certain business's can only operate in certain areas:rolleyes:. He could be selling pharmaceuticals that could be illegal in other countries. Often read about people being imprisoned because their painkillers have a trace of an substance that is illegal in their holidaying country.:)

Share This Page