Mod-Rewrite Error in SEO htaccess

New to mod_rewrite? This is a good place to start.

Mod-Rewrite Error in SEO htaccess

Postby fortune81 » Mon Aug 31, 2009 2:13 pm

I was notified by my host of a large number of entries in my site's error log stating:
[Mon Aug 31 14:22:33 2009] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.

So I took a look at the .htaccess file, but it is full of SEO 'friendly URL' stuff that I can't begin to sort out.

Does anyone have any idea of how to fix this problem? Here's the htaccess file in question. The offending '-f' is in the third line from the bottom.

Thanks!

*******************************************
Options +FollowSymLinks

RewriteEngine On

RewriteBase /



# From Ultimate SEO URLs

RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]

RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]

RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]

RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]

RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]



# For Open Operations Info Manager

RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]



# For dreamscape's News & Articles Manager

RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]

RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]

RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]

RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]

RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]

RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]

RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]



# All other pages

# Don't rewrite real files or directories

RewriteCond %{REQUEST_FILENAME} !-f [NC]

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]
fortune81
 
Posts: 2
Joined: Mon Aug 31, 2009 2:07 pm

Postby richardk » Mon Aug 31, 2009 2:49 pm

It's not an error, just a warning. It's saying the NC (No Case) flag on this line
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f [NC]

is not doing anything. It ([NC]) just needs removing.

Cleaned up
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# From Ultimate SEO URLs
RewriteRule ^.+-p-(.+)\.html$       /index.php?main_page=product_info&products_id=$1         [QSA,L]
RewriteRule ^.+-c-(.+)\.html$       /index.php?main_page=index&cPath=$1                      [QSA,L]
RewriteRule ^.+-m-([0-9]+)\.html$   /index.php?main_page=index&manufacturers_id=$1           [QSA,L]
RewriteRule ^.+-pi-([0-9]+)\.html$  /index.php?main_page=popup_image&pID=$1                  [QSA,L]
RewriteRule ^.+-pr-([0-9]+)\.html$  /index.php?main_page=product_reviews&products_id=$1      [QSA,L]
RewriteRule ^.+-pri-([0-9]+)\.html$ /index.php?main_page=product_reviews_info&products_id=$1 [QSA,L]

# For Open Operations Info Manager
RewriteRule ^.+-i-([0-9]+)\.html$   /index.php?main_page=info_manager&pages_id=$1            [QSA,L]

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$                                  /index.php?main_page=news                        [QSA,L]
RewriteRule ^news/rss\.xml$                           /index.php?main_page=news_rss                    [QSA,L]
RewriteRule ^news/archive/?$                          /index.php?main_page=news_archive                [QSA,L]
RewriteRule ^news/([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ /index.php?main_page=news&date=$1                [QSA,L]
RewriteRule ^news/archive/([0-9]{4}-[0-9]{2})\.html$  /index.php?main_page=news_archive&date=$1        [QSA,L]
RewriteRule ^news/.+-a-([0-9]+)-comments\.html$       /index.php?main_page=news_comments&article_id=$1 [QSA,L]
RewriteRule ^news/.+-a-([0-9]+)\.html$                /index.php?main_page=news_article&article_id=$1  [QSA,L]

# All other pages
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)\.html$ /index.php?main_page=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Thanks!

Postby fortune81 » Mon Aug 31, 2009 3:03 pm

Thank you so much. It always amazes me when I can find an expert in a particular field who can make short work of a problem - and with a super fast response to boot!
fortune81
 
Posts: 2
Joined: Mon Aug 31, 2009 2:07 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 25 guests

cron