Site icon Hip-Hop Website Design and Development

404 error when I tried to use author slug in url

basically, I created a custom physical page called (page-team.php) after that I created a page from the dashboard called team and assign a template to the physical page that I mention before.

I tried to use function get_user_by(‘slug’,$author_name) by fetching value from URL (https://my-domain/team/authorName) usually redirects me to 404 page the only way to fetch data to use URL like this (https://my-domain/team/?author=authorName) by this way I can display author data in page

for SEO purposes is there any way to use the first URL (https://my-domain/team/authorName) than the second one

my default page (https://my-domain/author/authorName) working normally I need to fetch the same data to the user for the team page. is there any way to solve this?

I appreciated any answer 🙂