完了

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