How do I change my site’s visitors URL to completely lowercase?
Example:
If they type “example.com/Foldername/Pagename ” it would show the page “example.com/foldername/pagename ”
I tried adding this .htaccess code, but it didn’t work after clearing cache and reloading. I did read that you might need to change something in the httpd.conf, but free hosting doesn’t let you access that correct?
RewriteEngine On
CheckSpelling On
CheckCaseOnly On
Yes, I only have one line of “RewriteEngine On”
Thanks!
Oxy
July 16, 2021, 9:23pm
2
.htaccess, redirect
or if it is important for you to parse the entry
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Btw. why do you think someone would type an address
unless it is just a domain name ?
I doubt anyone will type a few / directories / structure /
especially when they don’t know what the right path is
2 Likes
Thanks for the link. I couldn’t get this one to work,
<IfModule mod_speling.c>
CheckSpelling on
</IfModule>
But this one worked instead (It was not the accepted answer)
RewriteCond expr "tolower(%{REQUEST_URI}) =~ /(.*)/"
RewriteRule [A-Z] %1 [R=301,L]
Do you know why only the second works here? I do have a different IfModule for cache, and now I question if it is working.
I don’t think anyone would do that. I want to add this because someone (Defiantly not me , so don’t even think about blaming me ), made half the links with the first letter uppercase and the other half with the first letter lowercase.
Correct! I definitely wouldn’t!
Admin
July 17, 2021, 11:16am
4
Greenreader9:
I don’t think anyone would do that. I want to add this because someone (Defiantly not me , so don’t even think about blaming me ), made half the links with the first letter uppercase and the other half with the first letter lowercase.
If you start typing URLs by hand, you will likely make a typo. Using uppercase letters when lowercase letters should be used is no exception.
You can’t stop people from shooting themselves in the foot by purposely typing incorrect URLs.
1 Like
Oxy
July 17, 2021, 11:58am
5
Probably this mode mod_speling
is not enabled in this configuration file httpd.conf
from the server
(you have no control over it)
possible reason - impact on the server’s performance
1 Like
I mean when I am making links. Like sometime I would type
<a href”/Foldername/Pagename”>Link</a>
And sometimes I would type (Correctly)
<a href=”/foldername/pagename”>Link</a>
That’s what I though. So would my other IfModual for controlling cache still work?
Thanks
Oxy
July 17, 2021, 3:27pm
7
You can simply test it
put this on top of the .htaccess file
<IfModule mod_nameOfModHere>
deny from YOUR-IP-HERE
</IfModule>
refresh your website
if you are blocked mod_XY is active
1 Like
system
Closed
July 24, 2021, 3:27pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.