Nextjs 13 get pathname on server
Unanswered
Serengeti posted this in #help-forum
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
Here's a php equivalent
<?php
$currentPath = $_SERVER['REQUEST_URI'];
echo $currentPath;
?>2 Replies
next/navigation works on server actions too