Submitted by kfawcett on Sun, 09/09/2012 - 21:18 Pro Licensee
I am running nginx and can see request_uri setup in fastcgi_param for the server, but the following code does not return anything for $_SERVER[REQUEST_URI];.
<?php
$old = $_SERVER[REQUEST_URI];
$new = str_replace('_', '-', $old);
$new = substr_replace($new, '/property', 0, 4);
header("Status: 301 Moved Permanently");
header("Location: $new");
?>
Any ideas how to get the variable to work?
Status:
Closed (fixed)
Comments
Submitted by kfawcett on Sun, 09/09/2012 - 21:36 Pro Licensee Comment #1
Figured it out. I had to put "fastcgi_param REQUEST_URI $request_uri;" in the location, even though it was already specified for the server.