Use WordPress helper function rather than custom function for nginx inde.php permalink fixer.