How do I make URLs case insensitive in Linux server
You can easily make the apache webserver ignore the case by using the mod_speling module, which is part of the standard apache distribution:
CheckSpelling On
CheckCaseOnly On
After restarting httpd you can access read
as Read
or READ
or read
.
Case sensitive urls in apache
You can easily done by using the mod_speling module, which is part of the standard apache distribution:
CheckSpelling On
CheckCaseOnly On
After restarting httpd you can access ABC as Abc or abc
I want to configure a Case InSenSitive web server
If you have access to the server config then there isn't really any need for .htaccess
(unless this helps with distribution).
Try the following instead:
<VirtualHost *:80>
# Assuming you want to access the domain apex as well?
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
# Case-Insensitive
CheckSpelling on
CheckCaseOnly on
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
And remove the .htaccess
file.
Note the DocumentRoot (the root directory of your site) is /var/www/html
. It is this directory that you need to grant access to in the corresponding <Directory>
container. And is ordinarily the directory that the .htaccess
file should be located (if enabled).
How would I make Apache case insensitive for urls and case sensitive for parameters
Use [NC]
flag.
Use of the [NC] flag causes the RewriteRule to be matched in a
case-insensitive manner. That is, it doesn't care whether letters
appear as upper-case or lower-case in the matched URI.
Refrences:
https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_nc
Can I make an Apache running on Windows case-sensitive?
As far as I know you can't, but I will watch this question for other answers.
As a workaround, you say that you must develop on Windows. What about installing Linux in a Virtual PC. There are several free VM programs like VirtualBox and Microsoft Virtual PC. That way, you can match your development environment to your deployment environment.
Beyond that, I find that it is best to just make sure you use lowercase for everything, minimizing mistakes.
Case Insensitive URLs with mod_rewrite
CheckSpelling on
Matches files and directories. See the documentation for details.
Related Topics
How to Join Columns of Two Files in Unix System
Perf: Strange Relation Between Software Events
How to Make Sudo Save The Password
The Behavior When a Gnu Make Phony Target Happens to Be The Same as a Directory Name
Compiling Kernel Error: Stdio.H: No Such File or Directory
How to Use 'Catdoc' to Display Dock File Encoded in Utf-8
Can't Increment a 0-Padded Number Past 8 in Busybox Sh
Watchman Makes Fsnotify Spuriously Detect File Changes
Floating Point Rounding in Shell
Git Clone Repository in a Specific Folder But Keep Default Folder Name
Set Preferred Listen Address in Weblogic 11G
How to Do In-Memory Binary Search in Bash
Git Status Between Windows and Linux Does Not Agree
Parallel Processes: Appending Outputs to an Array in a Bash Script
Ssl/Qsslsocket_Openssl.Cpp:1414: Error: Q_Ssl_Ctrl Was Not Declared in This Scope Error