1

I have urls like this: https://mypage.com/username-2023

I need to exectute an index.php in the root directory and fetch the path info "username-2023" in this index.php.

I tried this:

var_dump(parse_url($url, PHP_URL_PATH));

but i always get:

"The requested URL /username-2023 was not found on this server."

When i tried to redirect every path to "/" via .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/?$ [NC]
RewriteRule ^.*$ / [L,R=301]

The parse URL PATH information is empty.

Is there any way to get this managed?

fhammer
  • 81
  • 1
  • 8

0 Answers0