Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving htaccess rules to support clean urls with query string like
http://localhost/api/orders.json?foo=1&bar=2 (will be rewritten in http://localhost/api/index.php?uri=orders.json&foo=1&bar=2)
- Loading branch information
Fabrice Luraine
committed
Aug 5, 2010
1 parent
2bc8f84
commit a256b36
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<IfModule mod_rewrite.c> | ||
Options +FollowSymlinks | ||
Options +Indexes | ||
RewriteEngine on | ||
# RewriteBase /my_app/ # if your app is in a subfolder | ||
|
||
# test string is a valid files | ||
RewriteCond %{SCRIPT_FILENAME} !-f | ||
# test string is a valid directory | ||
RewriteCond %{SCRIPT_FILENAME} !-d | ||
|
||
RewriteRule ^(.*)$ index.php?uri=/$1 [NC,L,QSA] | ||
# with QSA flag (query string append), | ||
# forces the rewrite engine to append a query string part of the | ||
# substitution string to the existing string, instead of replacing it. | ||
</IfModule> |