Виконано

cloudflare workers custom recipe

Hello

I have cloudflare worker recipe for redirecting visitor from some country to another subdomain ,

i need to redirect the visitors with keeping on requested link like if the user request url like [login to view URL]

to be like

[login to view URL]

my current recipe worker code is :

-----------------------------------------------------------------------------------------------------

async function handleRequest(request) {

return redirect(request, 'subdomain')

}

addEventListener('fetch', event => {

[login to view URL](handleRequest([login to view URL]))

})

/**

* Returns a redirect determined by the country code

* @param {Request} request

*/

function redirect(request) {

// The `cf-ipcountry` header is not supported in the previewer

const country = [login to view URL]('cf-ipcountry')

const url = countryMap[country]

return [login to view URL](url)

}

/**

* A map of the url's to redirect to

* @param {Object} countryMap

*/

const countryMap = {

"us" : "[login to view URL]",

"uk": "[login to view URL]"

}

-----------------------------------------------------------------------------------------------------

this is redirect users to defined subdomain and i have tried some variables at the end like htaccess redirect :D but its not working any way i need to customize the code to redirect to the requested url with changing www to the subdomain based on defined country's in the recipe .

Thank You

Навички: PHP, JavaScript, WordPress, Архітектура ПЗ, Java

Деталі: cloudflare workers examples, cloudflare workers pricing, cloudflare workers html rewriter example, cloudflare workers sites, cloudflare workers cli, cloudflare workers redirect, cloudflare workers database, cloudflare worker return 404, custom google numbered map markers, custom markers directions map, custom united states map markers, custom google campus map, custom marker google map script, custom markers google map drupal, custom markers google map, draw custom circle google map, custom pins google map javascript, joomla custom html google map, custom marker google map, draw custom road google map

Про роботодавця:
( 1 відгук ) Cairo, Egypt

ID Проекту: #25658880

Доручено:

PaoloBarbolini

Hi, I think I've already seen the issue and I can fix it in less than 1 hour. I've started working with cloudflare workers when they came out and I've had many projects with them before on freelancer. Write to me in Більше

$30 USD за 7 дні(-в)
(9 відгуків(-и))
3.6

3 фрілансерів(-и) у середньому готові виконати цю роботу за $28

codetechservices

We are a team of expert WordPress developers having expertise in designing and developing eye-catchy, elegant, professional and responsive websites. We will give you quality , beautiful and smooth website with necessa Більше

$20 USD за 7 дні(-в)
(41 відгуків(и))
6.1
usmanbinwaheed

Hi sir, I have read your description, I am an experienced Wordpress developer and expert at Wordpress website speed optimization. feel free to contact me!

$35 USD за 1 день
(3 відгуків(и))
3.1