Redirect all URLs in WordPress and Permalink to by country to subdomain

You can try to check the visitor country via the geojs.io, and then build the logic for redirecting. See the JS code below: geoTargeting(); function geoTargeting() { return new Promise((resolve, reject) => { fetch(‘https://get.geojs.io/v1/ip/country.json’).then(response => response.json()).then(data => { const currentHostname = window.location.hostname; const currentPath = window.location.pathname; let newUrl; if (data.country === ‘US’) { // Check … Read more

Lost WordPress website access after changing URL [closed]

If you have a cPanel and have an access of phpMyAdmin on your host, then find your DB, check the “siteurl” and “home” fields are correct in wp_options Table. Or Add these two lines to your wp-config.php, where “example.com” is the correct location of your site. define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); Or If you have a cli access, … Read more