Fishpig:由于index.php,自动登录无法正常工作,身份验证异常 [英] Fishpig: Autologin not working authentication exception because of index.php

查看:104
本文介绍了Fishpig:由于index.php,自动登录无法正常工作,身份验证异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了Fishpig Wordpress集成以及Magento CE 1.702.

I have Fishpig Wordpress Integration installed along with Magento CE 1.702.

Wordpress的设置如下:

Wordpress is set up like this :

Database
    Charset                              utf8
    Table Prefix                         wp_
integration
    Integrate Theme                      Yes
    Home URL                             blog
    Path                                 wp
    Single Store                         no

我使用此重写规则从前端删除了index.php:

I removed index.php from the frontend using this rewrite rule :

`<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>`

问题是Fishpig Wordpress自动登录已停止处理错误:

The problem is the Fishpig Wordpress autologin has stopped working with the error:

无法登录.在下面查看您的WordPress管理员登录详细信息.

Unable to login. Check your WordPress Admin login details below.

Stacktrace:

Stacktrace :

> 2014-05-08T13:25:36+00:00 DEBUG (7): exception 'Exception' with message 'WordPress Auto Login Failed: HTTP/1.1 401 Authorization Required
Date: Thu, 08 May 2014 13:25:36 GMT
Server: Apache/2.2.22
Vary: Accept-Encoding
Content-Length: 482
Content-Type: text/html; charset=iso-8859-1' in /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/community/Fishpig/Wordpress/Helper/System.php:493
Stack trace:
#0 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/community/Fishpig/Wordpress/controllers/Adminhtml/WordpressController.php(34): Fishpig_Wordpress_Helper_System->loginToWordPress('myUserName', 'myPassword', 'http://dummyurl...')
#1 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Fishpig_Wordpress_Adminhtml_WordpressController->loginAction()
#2 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('login')
#3 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#6 /nfs/c03/h03/mnt/168517/domains/dummyurl.com/html/index.php(87): Mage::run('', 'store')
#7 {main}

我联系了Fishpig的支持人员,他们说:

I contacted Fishpig support and they said :

您需要将Magento安装配置为不使用index.php.

You need to configure your Magento installation not to use index.php.

我这样从管理区域中删除了index.php:

I removed index.php from the admin area like this :

    RewriteRule ^index.php/admin/(.*)$ /my-admin/$1 [L,R]

这不能解决自动登录问题,我注意到自动登录按钮的URL包含index.php,因此我在wordpress.htaccess中删除了index.php,如下所示:

This didn't fix the autologin problem and I noticed that the autologin button url contained the index.php so I removed index.php in the wordpress .htaccess like this :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
RewriteRule ^/wp/index.php/(.*)$ /wp/$1 [L,R]
</IfModule>

这从管理员网址中删除了index.php,但未在自动登录按钮中删除

This removed the index.php from the admin url but not in the autologin button

http://dummyurl.com/index.php/admin /wordpress/login/key/72a947f0e9452bfd6e92258d31ce7cd2/

我一直在搜索并破坏了我的头,我们将为您提供任何帮助.

I have been searching and wrecking my head with this, any help is appreciated.

推荐答案

要使自动登录功能正常运行,您只需要.htaccess文件中的默认内容,而无需在此处添加任何自定义代码.以下是您所需要的:

To get the auto-login functionality working, you only require the default content in your .htaccess file and do not need to add any custom code in here. The following is all you need:

# BEGIN WordPress
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /wp/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress

如果您将实际的URL包含在您的Magento网站中,将会很有帮助,因为这将很快回答一些问题.

It would help if you included the actual URL to your Magento site, as this would very quickly answer a few questions.

这篇关于Fishpig:由于index.php,自动登录无法正常工作,身份验证异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆