Blog «htaccess»)
Apache Error HTTPD: NoCase option for non-regex pattern is not supported and will be ignored.
An Apache error came to fill all our Apache error_logs. We (programmers) tend to use the [NC] flag in the .htaccess files that we create so that Apache doesn't consider the case when using RewriteCond.
The error is:
[warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored. [warn] RewriteCond: NoCase option for non-regex pattern '-d' is not supported and will be ignored.
So instead of using in .htaccess:
RewriteCond %{REQUEST_FILENAME} !-f [NC,OR]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
prefer to use:
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
Another (yet better!) solution is to use:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule "." - [skip=100]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule "." - [skip=100]
.htaccess: URL without "www"
Some people say you shouldn't have two different URLs pointing to exactly the same place, without redirection.
However, it's an esthetic choice to show, or not, the "www" in front of the domain name. So, if you prefer not having the "www", use:
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
If you rather prefer having the "www", use:
RewriteCond %{HTTP_HOST} !^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Note that your Apache server should have MOD_REWRITE enabled.
Categories
All articles, Design, E-Commerce, Free stuff, Internal, Kitch website of the day, Mobile, Web, Web Marketing,
Tags
quétaine, Sparko, Montréal, htaccess, java, la presse, marketing, rewriteCond, site quétaine, accents, accesnotaire.com, affaires, Agence de développement web, amazon, apache, apple, archambault, autoVer, back-up, backup,

0