Pico/.htaccess
Daniel Rudolf 6465c2b0a9
Support REQUEST_URI routing method
With Pico 1.0 you had to setup URL rewriting (e.g. using `mod_rewrite` on Apache) in a way that rewritten URLs follow the `QUERY_STRING` principles. Starting with version 1.1, Pico additionally supports the `REQUEST_URI` routing method, what allows you to simply rewrite all requests to just `index.php`. Pico then reads the requested page from the `REQUEST_URI` environment variable provided by the webserver. Please note that `QUERY_STRING` takes precedence over `REQUEST_URI`.
2016-04-24 20:11:05 +02:00

22 lines
598 B
ApacheConf

<IfModule mod_rewrite.c>
RewriteEngine On
# May be required to access sub-directories
#RewriteBase /
# Deny access to internal dirs by passing the URL to Pico
RewriteRule ^(.git|config|content|content-sample|lib|vendor)(/|$) index.php [L]
# Enable URL rewriting
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
<IfModule mod_env.c>
# Let Pico know about available URL rewriting
SetEnv PICO_URL_REWRITING 1
</IfModule>
</IfModule>
# Prevent file browsing
Options -Indexes -MultiViews