而非官方dir structure:
/path/www.mysite.com/
public_html/ <-- Document root!
.htaccess
index.php <-- I instantiate Slim here!
lib/
Slim/ <-- I store Slim lib files here!
我打算使用:
/
api/
Slim/
.htaccess
app.php <-- Slim app
webapp/
client-site/
scripts/
.../
.htaccess
index.html
other-static.html
以下.htaccess
重写:
/.htaccess
#e.g. for wines API (http://localhost/wines)
RewriteRule ^wines$ api/wines [QSA]
/api/.httaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ app.php [QSA,L]
app.php定义了Slim routing。
为什么Slim没有提取/葡萄酒?
示例在GitHub
上