I was trying to shorten the url
more, but I was removing .php
or .html
file extension from the urls using url rewriting too. I can't run both at the same time.
Removing the extensions and trying to shorten link from
site.com/profile.php?id={username}
to
site.com/username.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9-z]+)$ profile.php?id=$1 [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^\..*?$ $1.html [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^\..*?$ $1.php [NC,L]
Just the first thing I'm trying to do works, or removing extension(but not both, not .html and .php at the same time), or removing profile.php?id, not both.