21282 Posts in 5730 Topics by 2601 members
General Questions
SilverStripe Forums » General Questions » Useless mod_rewrite rule in the default silverStripe .htaccess ?
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1255 Views |
-
Useless mod_rewrite rule in the default silverStripe .htaccess ?

10 November 2009 at 5:10am Last edited: 17 November 2009 1:25am
Hello,
In my .htaccess file, i have mod_rewrite rules :
RewriteEngine On
RewriteBase /RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]It's OK, these default rules works. But, i've read in this page about Rewrite rules :
A wrong assumption is that the conditions are processed before the pattern of the RewriteRule. But this is wrong. The processing order is as follows:
1 - The Pattern of the RewriteRule is checked first.
....So, i'm wondering : is RewriteCond %{REQUEST_URI} ^(.*)$ usefull ? It seems to be almost the same as .* pattern of the RewriteRule.
Perhaps Could we write :
RewriteEngine On
RewriteBase /Tests_CMS/SilverStripeRewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ sapphire/main.php?url=%1&%{QUERY_STRING} [L]thanks for your explanations.
| 1255 Views | ||
|
Page:
1
|
Go to Top |

