I am currently using this type of mod_rewrite code for all my page…but i think its too long. There must be a shorter way of writing same code? and does it increase any kind of load on he server?
RewriteRule ^Login/$ login.php [L]
RewriteRule ^login/$ login.php [L]
RewriteRule ^Login$ login.php [L]
RewriteRule ^login$ login.php [L]
the first line is for normal url – “http://website/Login/”
second one is if the user doesn’t type the capital “L” – “http://website/login/”
third one is if he doesn’t add an ending slash on the first url – “http://website/Login”
fourth one is if he doesn’t add an ending slash on the second url – “http://website/login”
Try this regex:
[Ll] matches either L or l, question mark means the previous character (slash) is optional.