def METHOD_NAME(request):
    name = request.params.get("name")
    version = request.params.get("version")
    if not name:
        raise HTTPNotFound
    if version:
        return HTTPMovedPermanently(
            request.route_path("packaging.release", name=name, version=version)
        )
    return HTTPMovedPermanently(request.route_path("packaging.project", name=name))