Hi,
In my NGINX conf, I'd like to set-up my site with vanity URLs when the file doesn't exist.
This works for the most part, but I'd like to have the vanity URL include periods, underscores, dashes, and any alphanumeric characters: rewrite ^/([a-zA-Z0-9-_]+)$ /profile.php?url=$1 last;
I'd only like to rewrite to the profile if the path doesn't exist. profile.php will throw a 404 header and error message if the user doesn't exist.
Right now, only vanity URLs with alphanumeric characters work. If I add \. to the rewrite line, then none of my pages work and vanity URLs work. example.com/katie.vw should be a vanity URL, but I guess my site thinks it's a file name.
In my NGINX conf, I'd like to set-up my site with vanity URLs when the file doesn't exist.
This works for the most part, but I'd like to have the vanity URL include periods, underscores, dashes, and any alphanumeric characters: rewrite ^/([a-zA-Z0-9-_]+)$ /profile.php?url=$1 last;
I'd only like to rewrite to the profile if the path doesn't exist. profile.php will throw a 404 header and error message if the user doesn't exist.
Right now, only vanity URLs with alphanumeric characters work. If I add \. to the rewrite line, then none of my pages work and vanity URLs work. example.com/katie.vw should be a vanity URL, but I guess my site thinks it's a file name.