[TASK] Remove typo3/.htaccess 82/50582/4
authorMarkus Klein <markus.klein@typo3.org>
Thu, 10 Nov 2016 17:22:56 +0000 (18:22 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 12 Nov 2016 17:10:03 +0000 (18:10 +0100)
The current solution caused a lot of troubles with server configuration.
To avoid any nasty workarounds we simply create a real entry point again.

Resolves: #78645
Releases: master, 7.6
Change-Id: I9003ffe8308290a145fe36a1e9ff884016ea0523
Reviewed-on: https://review.typo3.org/50582
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Kiessling <andreas.kiessling@web.de>
Tested-by: Andreas Kiessling <andreas.kiessling@web.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
19 files changed:
typo3/.htaccess [deleted file]
typo3/ajax.php [new file with mode: 0644]
typo3/alt_clickmenu.php [new file with mode: 0644]
typo3/alt_db_navframe.php [new file with mode: 0644]
typo3/alt_doc.php [new file with mode: 0644]
typo3/alt_file_navframe.php [new file with mode: 0644]
typo3/browser.php [new file with mode: 0644]
typo3/db_new.php [new file with mode: 0644]
typo3/dummy.php [new file with mode: 0644]
typo3/init.php [new file with mode: 0644]
typo3/install/index.php [new file with mode: 0644]
typo3/login_frameset.php [new file with mode: 0644]
typo3/logout.php [new file with mode: 0644]
typo3/mod.php [new file with mode: 0644]
typo3/move_el.php [new file with mode: 0644]
typo3/show_item.php [new file with mode: 0644]
typo3/tce_db.php [new file with mode: 0644]
typo3/tce_file.php [new file with mode: 0644]
typo3/thumbs.php [new file with mode: 0644]

diff --git a/typo3/.htaccess b/typo3/.htaccess
deleted file mode 100644 (file)
index bb5aa7c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<IfModule mod_rewrite.c>
-
-       RewriteEngine On
-       # Use options from the htaccess in the main directory of the frontend in order
-       # to have versioned static files and TYPO3_CONTEXT working
-       RewriteOptions inherit
-
-       # Store the current location in an environment variable CWD to use
-       # mod_rewrite in .htaccess files without knowing the RewriteBase
-       RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
-       RewriteRule ^.*$ - [E=CWD:%2]
-
-       # Block non-existing .map files, which are requested by some browsers.
-       # We need to do that this way here, because otherwise the rewrite logic
-       # of the parent folder will redirect such a request to the typo3/index.php
-       # causing the BE (login) to be returned.
-       # This is due to the nature of 'RewriteOptions inherit', which copies the rules
-       # virtually into this file (at the end) and then the defined rules, which include
-       # 'typo3/' will not match in the context of this file.
-       RewriteRule \.map$ - [F]
-
-       # Redirect install tool files
-       RewriteRule ^install(\/?.*)$ %{ENV:CWD}sysext/install/Start/Install.php [R=307,L]
-
-       # Redirect old entry points
-       RewriteRule ^(ajax|alt_clickmenu|alt_db_navframe|alt_doc|alt_file_navframe|browser|db_new|dummy|init|login_frameset|logout|mod|move_el|show_item|tce_db|tce_file|thumbs)\.php$ %{ENV:CWD}deprecated.php
-</IfModule>
\ No newline at end of file
diff --git a/typo3/ajax.php b/typo3/ajax.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/alt_clickmenu.php b/typo3/alt_clickmenu.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/alt_db_navframe.php b/typo3/alt_db_navframe.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/alt_doc.php b/typo3/alt_doc.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/alt_file_navframe.php b/typo3/alt_file_navframe.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/browser.php b/typo3/browser.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/db_new.php b/typo3/db_new.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/dummy.php b/typo3/dummy.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/init.php b/typo3/init.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/install/index.php b/typo3/install/index.php
new file mode 100644 (file)
index 0000000..e0817d8
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+// This is a stub file for redirecting the user to the proper Install Tool URL
+
+call_user_func(function () {
+
+    // We leverage the class loader here to get the static functionality of GeneralUtility and HttpUtility.
+    // This way we do not need to copy all the code here to cope with correct location header URL generation correctly
+    // as those two classes can already correctly deal with all known edge cases.
+
+    require __DIR__ . '/../../vendor/autoload.php';
+
+    // We ensure that possible notices from Core code do not kill our redirect due to PHP output
+    error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
+
+    \TYPO3\CMS\Core\Utility\HttpUtility::redirect('../sysext/install/Start/Install.php', \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_307);
+});
diff --git a/typo3/login_frameset.php b/typo3/login_frameset.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/logout.php b/typo3/logout.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/mod.php b/typo3/mod.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/move_el.php b/typo3/move_el.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/show_item.php b/typo3/show_item.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/tce_db.php b/typo3/tce_db.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/tce_file.php b/typo3/tce_file.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';
diff --git a/typo3/thumbs.php b/typo3/thumbs.php
new file mode 100644 (file)
index 0000000..ae2042a
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+require __DIR__ . '/deprecated.php';