Assistance configuring htaccess rule for Geo redirect, excluding some URL/user-agents

  • Posted:
  • Proposals: 3
  • Remote
  • #1761384
  • Awarded
Skywave Infotech
Md. Ashikur Rahman A.Bobby B. have already sent a proposal.
  • 0


Experience Level: Intermediate
General information for the website: Ecommerce store
Kind of development: Customization of existing website
Description of requirements/features: I currently use the config below to redirect users accessing my site from US|CA to my us. subdomain. I am wanting to amend this to achieve the below

1. exclude any urls including /affiliate-area/ from being redirected ( regardless of country)
2. exclude all search bots from being redirected
3. exclude any URLs with including ?noredirect=true


# Set the CF-IPCountry header value as "Country" variable
SetEnvIf CF-IPCountry "(.*)$" Country=$1
# Than redirect it if the variable match. "US" for USA
RewriteCond %{ENV:Country} (US|CA)
RewriteRule ^(.*)$$1 [R,L]

I added in the following code but it does not appear to be working correctly to exclude affiliate-area from being redirected.

RewriteCond %{REQUEST_URI} !^/affiliate-area/$ [NC]

For somebody that knows htaccess scripts this will only take a few minutes to resolve. Please dont send me crazy quotes.
Specific technologies required: htaccess apache nginx web hosting
Extra notes:

New Proposal

Create an account now and send a proposal now to get this project.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.