You can use.htaccess file with mod_rewrite module enabled on Apache2

RewriteEngine on
RewriteRule ^stats/([A-Za-z0-9-]+)/?$ stats.php?player=$1 [NC]

You can follow this simple tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite

In this case I used a simple regex in the RewriteRule, you can customize your regex whatever you like

EDIT: exceptions for static files

RewriteCond %{REQUEST_URI} !(public|css)
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]

please, read the docs

People are also looking for solutions to the problem: xml editing by php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.