Unable to access PhpMyAdmin when cakephp in installed in the server
我正在尝试将我的代码从localhost传输到活动域。服务器目录如下:
1 2 3 4 5 6 7 | -www.example.com --app --cake --vendors --plugins -- phpMyAdmin -- htaccess |
由于cakephp处理URL,因此当我尝试访问www.example.com/phpMyAdmin时,cakephp抱怨"找不到PhpmyAdminController"。我试图在app / webroot / htaccess中更改htaccess以允许phpMyAdmin的url,但它不起作用。有人可以帮忙吗?
我遵循了以下网站上的教程:http://cakebaker.42dh.com/2006/08/17/take-over-the-control-of-some-urls-from-cakephp/。但是我更改了webroot文件夹而不是主文件夹中的htaccess。
我真的很希望有人能帮忙。
您可以通过修改位于应用程序文件夹外部的
请尝试这个。我正在使用此特定代码及其对我有用。
1 2 3 4 5 6 | <IfModule mod_rewrite.c> RewriteEngine on Rewriterule ^phpmyadmin/.*$ - [PT] RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> |
现在您将能够运行这样的目录
我想我设法找到了答案,而无需重复phpmyadmin的最佳方法是:
1 2 3 4 5 6 7 | <IfModule mod_rewrite.c> RewriteEngine on rewritecond %{REQUEST_URI} ^/(phpMyAdmin)/ RewriteRule .* - [S=2] RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> |
上面的htaccess必须在蛋糕的根目录而不是webroot中进行更改。我不想获得荣誉,而荣誉归功于以下URL的论坛参与者:
http://cakephp.1045679.n5.nabble.com/Routing-to-an-external-application-td1274772.html
您可以将phpMyAdmin文件夹放在app / webroot /中。使用相同的URL访问(末尾带有斜杠)www.example.com/phpMyAdmin/