I'm in predicament where I must use settings.php to do what I'd normally just do via mod_rewrite... the site is being hosted on Pantheon and I am referring to this article: http://helpdesk.getpantheon.com/customer/portal/articles/368354
I need to send the original requested path for reference. Trying to pass a the SERVER_URI as a parameter via header location in setting.php gets me an infinite loop.
My code:
if (preg_match('/article\/[0-9]?[0-9]\/[0-9]?[0-9]\/[aA-zZ].+/', $_SERVER['REQUEST_URI'])) {
header('HTTP/1.0 301 Moved Permanently');
header("Location: http://answers3x-ec-core-community.gotpantheon.com/catchall/?dest=" . urlencode($_SERVER["REQUEST_URI"])); exit;
}
Anybody have any suggestions as to how I might accomplish passing the $_SERVER["REQUEST_URI"] via header location from settings.php without an infinite loop?
/^
. Or maybe/^\/
depending on your web server setup. That should stop the loop