有一个 CakePHP 应用程序。我们需要它在 SSL 上工作。由于 1&1 的 Apache 配置方式(神秘且显然是秘密的),它拒绝对不正确存在的文件的请求。正因为如此,我们关闭了 CakePHP 的永久链接,取消注释
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
..在app/Config/core.php
由于应用程序使用漂亮的永久链接链接到自身,我们需要从漂亮的永久链接重定向到非漂亮的。
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/papers/paper$
RewriteRule (.*) (our domain name)/index.php/papers/paper [R=301,L]
但是,当访问应用程序的特定页面时,服务器会无缘无故/papers/paper
地返回重定向。/index.php/kunden/homepages/21/d286159521/htdocs/hr/hr.advancedcarellc.com/index.php/papers/paper
即使禁用任何相关的 .htaaccess,也会出现此行为。
然而,跑步grep -r "kunden"
会给
./lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['DOCUMENT_ROOT'] = '/kunden/homepages/4/d181710652/htdocs/joomla';
./lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['SCRIPT_FILENAME'] = '/kunden/homepages/4/d181710652/htdocs/joomla/dbhauser/index.php';
./test/lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['DOCUMENT_ROOT'] = '/kunden/homepages/4/d181710652/htdocs/joomla';
./test/lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['SCRIPT_FILENAME'] = '/kunden/homepages/4/d181710652/htdocs/joomla/dbhauser/index.php';
./test/test/lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['DOCUMENT_ROOT'] = '/kunden/homepages/4/d181710652/htdocs/joomla';
./test/test/lib/Cake/Test/Case/Network/CakeRequestTest.php: $_SERVER['SCRIPT_FILENAME'] = '/kunden/homepages/4/d181710652/htdocs/joomla/dbhauser/index.php';
这似乎暗示重定向是由某种绝对路径/相对路径不匹配引起的,但我想不出任何实际做任何重定向的事情。
我还会怀疑 1&1 的某些隐藏配置方式。有没有人有 1&1 和 CakePHP 的经验?