I'm quite new to .htaccess
and I just didn't get into it enough to understand what's going on. The server just says, limit of 10 internal redirects exceeded even though I can't see any reason for it to "redirect". It only happens when I try to use /users/Username
, /users/
shows an error that this user can't be found which is like I wanted it, /users/Username
throws a 500 Internal Server Error. The document itself is fine, the database check should also work. The .htaccess
document is:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
IndexIgnore *
ErrorDocument 400 /
ErrorDocument 404 /
RewriteRule ^users/([a-zA-Z0-9_-]+)/?$ users.php?id=$1 [NC,L]