Skip to content

Commit a83b9c9

Browse files
author
Josh Lockhart
committed
Manually update htaccess and server preperation docs in README
1 parent cca2cf5 commit a83b9c9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.htaccess

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ RewriteEngine On
77
# RewriteBase /
88

99
RewriteCond %{REQUEST_FILENAME} !-f
10-
RewriteRule ^(.*)$ index.php [QSA,L]
10+
RewriteRule ^ index.php [QSA,L]

README.markdown

+14-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,25 @@ If you are running PHP < 5.3, the second argument to the application's `get()` i
6060

6161
Download the Slim Framework for PHP 5 and unzip the downloaded file into your virtual host's public directory. Slim will work in a sub-directory, too.
6262

63-
### Setup .htaccess
63+
### Setup your webserver
64+
65+
#### Apache
6466

6567
Ensure the `.htaccess` and `index.php` files are in the same public-accessible directory. The `.htaccess` file should contain this code:
6668

6769
RewriteEngine On
6870
RewriteCond %{REQUEST_FILENAME} !-f
69-
RewriteRule ^(.*)$ index.php [QSA,L]
71+
RewriteRule ^ index.php [QSA,L]
72+
73+
#### Nginx
74+
75+
Your nginx configuration file should contain this code (along with other settings you may need) in your `location` block:
76+
77+
if (!-f $request_filename) {
78+
rewrite ^ /index.php last;
79+
}
80+
81+
This assumes that Slim's `index.php` is in the root folder of your project (www root).
7082

7183
### Build Your Application
7284

0 commit comments

Comments
 (0)