Viewing 12 replies - 1 through 12 (of 12 total)
  • Inside the root directory create a file with the name of “index.php” and paste the following code (All visitors will be redirected!!!!)

    /*
    I have omitted the PHP opening and closing tags due to security restrictions of this forum
    */
    Header(“HTTP/1.1 301 Moved Permanently”);
    Header(“Location: https://www.gosell.co.uk/longon/”);

    What exactly would you like to achive ????
    Propably there is a better way for doing this .

    Thread Starter bblacklist

    (@bblacklist)

    The thing is my site is running in uk and i want to make it local classified u know i mean? if some open a site in manchester the my site should show him manchester local ad and my site url should be https://www.gosell.co.uk/manchester or manchester.gosell.co.uk i want a ciry redirect thats wat i want. and i ll detect user by their ip addresses.
    i hope explained it clearly.

    As I know it can be done with the “.htaccess” file or with PHP (I prefer PHP).
    This web-site provides a data-file and some PHP files . You have to make some slight modifications on these files , not a difficult proccess if you have basic knowledge of PHP .
    I made a test with the free version of this service , see it on my server . You can also use the paid version ( $20 per 50000 queries) .

    Thread Starter bblacklist

    (@bblacklist)

    yes someone said to me that u can do this with the help of directories sub/directories. i know the lil bit of php but once i cleared then i can do it to my own.

    the problem I see is how is wordpress – or the server – going to know what city someone is from? you can redirect according to country – but city?

    I think perhaps more realistic is your main page has links to user’s city and then is taken to page with their stuff.

    Thread Starter bblacklist

    (@bblacklist)

    u can detect user from their ip addressed once u have detected then u can take em to their respective pages etc.

    Thread Starter bblacklist

    (@bblacklist)

    or the other way is Hook into init action https://codex.www.ads-software.com/Function_Reference/add_action), detect where is your visitor from using some of available geoip solutions, and then use wp_redirect to redirect to the right url…

    good luck

    @samuel B

    the problem I see is how is wordpress – or the server – going to know what city someone is from? you can redirect according to country – but city?

    It’s posible to locate visitor’s location (country or city ) .
    I made a test on my server (with different proxy-servers) and it worked , visit this link .
    On WordPress create a page for each city : London , Birmingham , Manchester , Liverpool ……
    With a bit of PHP you can redirect visitor to the apropriate page .

    not really – how accurate is it?
    My ip says i’m from Dallas – I live over 30 miles away in Fort Worth – so being redirected to Dallas wouldn’t be relevant/
    so what do I do mow?

    I demonstrated the free version of this service , so it may not be 100% accurate for city-detection . The paid version ( $20 per 50000 queries) is probably more accurate .

    Thread Starter bblacklist

    (@bblacklist)

    On WordPress create a page for each city : London , Birmingham , Manchester , Liverpool ……
    With a bit of PHP you can redirect visitor to the apropriate page .

    good idea.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How is WordPress redirecting/rewriting my URL???’ is closed to new replies.