homepage Welcome to WebmasterWorld Guest from 54.167.144.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
WordPress WP Super Cache mod rewrite Rules
Seems to me that these rules could be simplified or corrected
MickeyRoush



 
Msg#: 4399389 posted 1:30 pm on Dec 19, 2011 (gmt 0)

Could I get your opinions on some of the aspects of the .htaccess rules that the WordPress plugin WP Super Cache utilizes?

They seem like they should be simplified and that the use of ".*" in certain places is not needed.

Example:
RewriteCond %{REQUEST_URI} !^.*[^/]$
Isn't that same as this:
RewriteCond %{REQUEST_URI} ![^/]$

More:
RewriteCond %{REQUEST_URI} !^.*//.*$
Same as:
RewriteCond %{REQUEST_URI} !//

RewriteCond %{QUERY_STRING} !.*=.*
Same as:
RewriteCond %{QUERY_STRING} !=

Below is a part of a line:
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry).* [NC]
Same as:
RewriteCond %{HTTP_USER_AGENT} !(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry) [NC]

I guess what I'm trying to say, isn't the use of ".*" unnecessary in these instances?

Any opinions, insights, recommendations, are greatly appreciated.

 

rominosj

10+ Year Member



 
Msg#: 4399389 posted 4:15 pm on Dec 19, 2011 (gmt 0)

But, why delete them if it is working fine?

Unless you have more than 3,000 lines in your htaccess file that is putting to much pressure on your server...

MickeyRoush



 
Msg#: 4399389 posted 5:34 am on Dec 20, 2011 (gmt 0)

But, why delete them if it is working fine?

Unless you have more than 3,000 lines in your htaccess file that is putting to much pressure on your server...


Because working just fine and working most efficiently (or correctly) are two different things. If there is one thing that I've learned from these forums, is that there are things you would be better off doing. And using the ".*" everything atom is definitely one of them.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved