Commit bda57d54 authored by Fabien Potencier's avatar Fabien Potencier

merged branch AD7six/patch-1 (PR #150)

Commits
-------

5ad81b90 QSA is also unnecessary. as pointed out by @mheleniak
5619a1b6 QSA is also unnecessary. as pointed out by @mheleniak
37f52330 remove unnecessary capturing group
c7e44c73 Remove unnecessary capturing group in suggested rewrite rule

Discussion
----------

Remove unnecessary capturing group in suggested rewrite rule

It's not used, nor needed.

---------------------------------------------------------------------------

by mheleniak at 2011/08/15 13:20:15 -0700

Same way `QSA,` could also be stripped in the same line, but this is so small, I think it's not worth the effort :-))

---------------------------------------------------------------------------

by igorw at 2011/08/15 15:12:36 -0700

@AD7six Please update `example.htaccess` as well.

@mheleniak I disagree, we do want the query string.

---------------------------------------------------------------------------

by mheleniak at 2011/08/15 15:16:14 -0700

@igorw please read the docs about QSA flag:

     'qsappend|QSA' (query string append)
     This flag forces the rewrite engine to append a query string part of the substitution
     string to the existing string, instead of replacing it. Use this when you want to add
     more data to the query string via a rewrite rule.

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

This option has nothing to do with passing query string to PHP and in our case can be safely removed.

---------------------------------------------------------------------------

by mheleniak at 2011/08/15 15:17:12 -0700

But as I said earlier such small changes usually takes more time to explain than has associated benefit with the change :)

---------------------------------------------------------------------------

by AD7six at 2011/08/16 00:48:53 -0700

@mheleniak - interesting perspective. Do you generally recommend doing things in php that aren't necessary to avoid explaining why it's unnecessary?

---------------------------------------------------------------------------

by AD7six at 2011/08/16 01:20:36 -0700

@mheleniak is right, the QSA flag is also unnecessary - removing it does not affect the contents of superglobals.

I made removing that a seperate commit so that you can cherry-pick if you prefer.

---------------------------------------------------------------------------

by lenar at 2011/08/17 10:03:55 -0700

Now that improved rule looks like what I've used for ages.
parents f263e64a 5ad81b90
......@@ -29,7 +29,7 @@ are using apache you can use a ``.htaccess`` file for this.
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
RewriteRule ^ index.php [L]
</IfModule>
.. note::
......
......@@ -4,5 +4,5 @@
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
RewriteRule ^ index.php [L]
</IfModule>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment