I don’t know why but when use the follow RewriteRule in my .htaccess file I am getting a Internal Server Error 500. I have mod_rewrite enabled I’ve been looking for a solution all day.
# Enable Rewriting
RewriteEngine on
# Rewrite user URLs
RewriteRule ^(.*)/?$ users\/$1\/index.php
Most likely the 500 error is due to a redirect loop.
You rewrite ANY request to
users/$1/index.phpincluding that very URL itself so you end up with a rewrite loop.Try changing your rewrite rules to this:
By checking that the URI doesn’t begin with
/usersyou can avoid the rewrite loop.