Redirect except for one url

edited June 2015 in Share
I have a site which will have more than 1 domain directed at it, and the canonical domain is a unicode one (it has an umlaut in it). For reasons I can't yet explain (it may be down to the browser or language settings [the site is German] or both) parts of the Fuel admin go into a recursive loop on pages handled by ajax and the module controller - in Firefox Windows mainly.

But of course, on a non-unicode domain, everything is OK. What I would like to do is redirect all domains / urls to the unicode one (as client requests, and search engines won't penalise for duplicate content) EXCEPT for /fuel/, which could operate on the non-unicode domain. I'm struggling to do this in htaccess, but there is the redirects config file too. Can I have a hole in the redirects config to allow that 1 url through?


  • edited 2:38AM
    It sounds like you would want to use "aggressive_redirects" (those that happen before it hits the routes or a controller). Depending on how comfortable you are with regular expressions, you can use them (similar to routes) which should give you the flexibility to do that (using something like ! can be used for "not" ).
  • edited June 2015
    Fortunately, for reasons like Google Analytics (and others), the client will now redirect from the unicode to the regular, which makes everything easier. I didn't realise these problems existed, so it's been an interesting journey!

    Thanks for the advice - I have used the redirects before, but not with extensive regex. I love regex, but you know the saying:
    Some people, when confronted with a problem, think
    “I know, I'll use regular expressions.” Now they have two problems.
  • edited 2:38AM
    Ha... I may have to use that one....
Sign In or Register to comment.