Next.js Discord

Discord Forum

Nextjs 13 get pathname on server

Unanswered
Serengeti posted this in #help-forum
Open in Discord
SerengetiOP
Hey, I was wondering if there was a way to get the pathname on the server without using 'next/navigation ' since, to my understanding, it needs to run on the client.

Here's a php equivalent
<?php
$currentPath = $_SERVER['REQUEST_URI'];
echo $currentPath;
?>

2 Replies