如何在htaccess链接中使用PERIOD?

I've tried to create a link like this: website.com/profile/name
from: website.com/profile.php?name=Name
Everything works fine, except when I use a name with a dot in it. So for example: website.com/profile/Alex. This wouldn't work, and would just remove the dot from the link. So basically it wouldn't display that DOT in php.

This is my htaccess code.

RewriteEngine On

ErrorDocument 404 /alliance/404.php

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^([^/.]+)\.php - [F,L,R=404]

RewriteRule ^([^/.]+)$ $1.php [L]

RewriteRule ^profile/([^/.]+)$ ./profile.php?name=$1

([^/.]+) means any chars except . and / so this does not match alex. . If you want your rule to accept . in uri, change your rule's pattern to the following :

RewriteRule ^profile/([^/]+)$ ./profile.php?name=$1