Following is my .htaccess
. It works good, but I got an error in error_log
file:
[warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.
<Files .htaccess>
order allow,deny
deny from all
</Files>
#Options +FollowSymlinks
DirectoryIndex index.php
Options All -Indexes
RewriteEngine on
# remove trailing slash
RewriteRule ^(.*)/$ /$1 [L,R=301]
#Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://www\.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^part_(\d+)$ /detail.php?id=$1 [NC]
RewriteRule ^find_(.+)$ /search.php?q=$1 [NC]
Not sure if this helps, but according to this website, if you see the following error in Apache error log:
[warn] RewriteCond: NoCase option for non-regex pattern ‘-f’ is not
supported and will be ignored
You should change the following line in your .htaccess
or httpd.conf
RewriteCond %{REQUEST_FILENAME} !-f [NC]
to
RewriteCond %{REQUEST_FILENAME} !-f
Note the missing [NC]
at the end of the line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With