user874185
user874185

Reputation: 853

.htaccess 500 Server Error on lowercase URLs

Im trying to make all my urls always lowercase when the user types in the url for example site.com/Personal would be site.com/personal... Ive tried 2 different ways and one doesnt work and the other gives a 500 internal server error.

500 Internal server error

RewriteMap lowercase int:tolower
RewriteCond $1 [A-Z]
RewriteRule ^/(.*)$ /${lowercase:$1} [R=301,L]

doesnt work

 <IfModule mod_speling.c>
  CheckCaseOnly On
  </IfModule>

Upvotes: 0

Views: 483

Answers (1)

Jon Lin
Jon Lin

Reputation: 143906

You cannot use RewriteMap in your .htaccess file. You can only use it in your server config or virtualhost config files. Also, if you are writing RewriteRules in an .htaccess file, the leading slash (the prefix) is removed, so you won't ever match ^/(.*) because there's never a leading slash.

Upvotes: 1

Related Questions