aboutsummaryrefslogtreecommitdiffhomepage
path: root/web
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-01-14 18:15:07 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-15 09:35:39 +0100
commit73cd160bfc6e4a1b88f2117eb0c097a91ac5c753 (patch)
treec5ccc9fa57f243126538ae8d9a2f8c459c08bd8c /web
parent1d405d0e62a708928bccd2222ebd89d4804231f9 (diff)
downloadwallabag-73cd160bfc6e4a1b88f2117eb0c097a91ac5c753.tar.gz
wallabag-73cd160bfc6e4a1b88f2117eb0c097a91ac5c753.tar.zst
wallabag-73cd160bfc6e4a1b88f2117eb0c097a91ac5c753.zip
Switch to Symfony 3 structure
Diffstat (limited to 'web')
-rw-r--r--web/.htaccess22
-rw-r--r--web/app.php2
-rw-r--r--web/app_dev.php2
-rw-r--r--web/robots.txt4
4 files changed, 22 insertions, 8 deletions
diff --git a/web/.htaccess b/web/.htaccess
index b52e3ae6..4dc72516 100644
--- a/web/.htaccess
+++ b/web/.htaccess
@@ -5,6 +5,18 @@
5# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). 5# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
6DirectoryIndex app.php 6DirectoryIndex app.php
7 7
8# By default, Apache does not evaluate symbolic links if you did not enable this
9# feature in your server configuration. Uncomment the following line if you
10# install assets as symlinks or if you experience problems related to symlinks
11# when compiling LESS/Sass/CoffeScript assets.
12# Options FollowSymlinks
13
14# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
15# to the front controller "/app.php" but be rewritten to "/app.php/app".
16<IfModule mod_negotiation.c>
17 Options -MultiViews
18</IfModule>
19
8<IfModule mod_rewrite.c> 20<IfModule mod_rewrite.c>
9 RewriteEngine On 21 RewriteEngine On
10 22
@@ -18,9 +30,9 @@ DirectoryIndex app.php
18 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 30 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
19 RewriteRule ^(.*) - [E=BASE:%1] 31 RewriteRule ^(.*) - [E=BASE:%1]
20 32
21 # Sets the HTTP_AUTHORIZATION header removed by apache 33 # Sets the HTTP_AUTHORIZATION header removed by Apache
22 RewriteCond %{HTTP:Authorization} . 34 RewriteCond %{HTTP:Authorization} .
23 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 35 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
24 36
25 # Redirect to URI without front controller to prevent duplicate content 37 # Redirect to URI without front controller to prevent duplicate content
26 # (with and without `/app.php`). Only do this redirect on the initial 38 # (with and without `/app.php`). Only do this redirect on the initial
@@ -34,15 +46,15 @@ DirectoryIndex app.php
34 # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 46 # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
35 # following RewriteCond (best solution) 47 # following RewriteCond (best solution)
36 RewriteCond %{ENV:REDIRECT_STATUS} ^$ 48 RewriteCond %{ENV:REDIRECT_STATUS} ^$
37 RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 49 RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
38 50
39 # If the requested filename exists, simply serve it. 51 # If the requested filename exists, simply serve it.
40 # We only want to let Apache serve files and not directories. 52 # We only want to let Apache serve files and not directories.
41 RewriteCond %{REQUEST_FILENAME} -f 53 RewriteCond %{REQUEST_FILENAME} -f
42 RewriteRule .? - [L] 54 RewriteRule ^ - [L]
43 55
44 # Rewrite all other queries to the front controller. 56 # Rewrite all other queries to the front controller.
45 RewriteRule .? %{ENV:BASE}/app.php [L] 57 RewriteRule ^ %{ENV:BASE}/app.php [L]
46</IfModule> 58</IfModule>
47 59
48<IfModule !mod_rewrite.c> 60<IfModule !mod_rewrite.c>
diff --git a/web/app.php b/web/app.php
index cc2fefb5..5c5ee03b 100644
--- a/web/app.php
+++ b/web/app.php
@@ -6,7 +6,7 @@ use Symfony\Component\HttpFoundation\Request;
6 * @var Composer\Autoload\ClassLoader 6 * @var Composer\Autoload\ClassLoader
7 */ 7 */
8$loader = require __DIR__.'/../app/autoload.php'; 8$loader = require __DIR__.'/../app/autoload.php';
9include_once __DIR__.'/../app/bootstrap.php.cache'; 9include_once __DIR__.'/../var/bootstrap.php.cache';
10 10
11// Enable APC for autoloading to improve performance. 11// Enable APC for autoloading to improve performance.
12// You should change the ApcClassLoader first argument to a unique prefix 12// You should change the ApcClassLoader first argument to a unique prefix
diff --git a/web/app_dev.php b/web/app_dev.php
index 635bf7ac..8456754d 100644
--- a/web/app_dev.php
+++ b/web/app_dev.php
@@ -12,7 +12,7 @@ use Symfony\Component\Debug\Debug;
12// Feel free to remove this, extend it, or make something more sophisticated. 12// Feel free to remove this, extend it, or make something more sophisticated.
13if (isset($_SERVER['HTTP_CLIENT_IP']) 13if (isset($_SERVER['HTTP_CLIENT_IP'])
14 || isset($_SERVER['HTTP_X_FORWARDED_FOR']) 14 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
15 || !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server') 15 || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
16) { 16) {
17 header('HTTP/1.0 403 Forbidden'); 17 header('HTTP/1.0 403 Forbidden');
18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); 18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
diff --git a/web/robots.txt b/web/robots.txt
index 77470cb3..214e4119 100644
--- a/web/robots.txt
+++ b/web/robots.txt
@@ -1,2 +1,4 @@
1# www.robotstxt.org/
2# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
3
1User-agent: * 4User-agent: *
2Disallow: / \ No newline at end of file