Forum Moderators: phranque

Message Too Old, No Replies

Can anyone explain to me what this one htaccess line does?

         

h2ojunkie

5:54 pm on Oct 26, 2006 (gmt 0)

10+ Year Member



I'm trying to move some htacess rules from a subdir up to wwwroot.

I understand what most of them are doing, and what i need to change in them when moving what dir they are in. (or at least i think i do)

But I don't understand this line.

RewriteCond %{REQUEST_URI}!(index\.php¦\.css) [NC]


This is the original htacess file that was in wwwroot/forum

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^([a-z0-9_\-]*-(f¦all)[0-9]+(p[0-9]+¦/index[0-9]*)?\.html)$ forumdisplay.php/$1 [QSA,L]
RewriteRule ^([a-z0-9_\-]*-(t¦p)[0-9]+(p[0-9]+¦/index[0-9]*)?\.html)$ showthread.php/$1 [QSA,L]
RewriteCond %{REQUEST_URI}!(index\.php¦\.css) [NC]
RewriteRule ^(archive¦sitemap)/(.*)$ $1/index.php/$2 [QSA,L]


I'm trying to move/combine the .htacess file from /forum with the one in wwwroot

This is what I have changed it to when moving it to wwwroot

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST}!^www\.mydomain\.com [NC]
RewriteCond %{HTTP_HOST}!^$
RewriteRule ^(.*) [mydomain.com...] [L,R=301]

RewriteRule ^forum/([a-z0-9_\-]*-(f¦all)[0-9]+(p[0-9]+¦/index[0-9]*)?\.html)$ forumdisplay.php/$1 [QSA,L]
RewriteRule ^forum/([a-z0-9_\-]*-(t¦p)[0-9]+(p[0-9]+¦/index[0-9]*)?\.html)$ showthread.php/$1 [QSA,L]
RewriteCond %{REQUEST_URI}!(index\.php¦\.css) [NC]
RewriteRule ^forum/(archive¦sitemap)/(.*)$ $1/index.php/$2 [QSA,L]


The first part is what I already had in the wwwroot .htaccess file to make sure they are visiting my site from www.mydomain.com (an not mydomain.com or www.mydomain.net, etc.)

The RewriteCond %{REQUEST_URI}!(index\.php¦\.css) [NC] line in the 2nd part is the one I'm not so sure about. I didn't make any changes to that line from what it originally was when in wwwroot/forum because I really don't understand what that line is supposed to do.

Any help is appreciated.

jdMorgan

6:07 pm on Oct 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IF the requested URI does NOT contain "index.php" OR ".css" THEN apply the following RewriteRule.

Note that the pattern should probably be end-anchored.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim