我想将所有http网址重定向到magento中的https,但仅用于前端.在magento中,我们有一种设置,可以使用安全的前端URL,如此链接中所述: https ://www.siteground/tutorials/magento/magento_ssl.htm ,但这仅适用于登录或签出后显示的页面.
I want to redirect all http urls to https in magento, but for front-endonly. In magento we have a setting to use secure urls for front-end as explained in this link: www.siteground/tutorials/magento/magento_ssl.htm but that applies to only pages shown after login or checkout.
我在.htaccess文件中应用了以下代码:
I have applied following code in my .htaccess file:
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ %{HTTP_HOST}/$1 [R,L]可以,但是也可以将管理面板的URL重定向到https.我不想要那样,我只希望前端不保护管理面板网址.
It is working ok, but it is redirecting Admin panel urls to https as well. I don't want that, I want only front-end to secure not the admin panel urls.
请检查并告知我们是否可以在magento中进行此类操作?
Please check and advise if we can do such thing in magento?
推荐答案首先删除您的规则.
然后,按照此参考转到您的管理区域.转到系统">配置">"Web">安全",然后打开在前端使用安全URL"和在管理员中使用安全URL"选项.
Then, as per this reference go to your admin area. Go to System > Configuration > Web > Secure and turn on the options "Use secure URLS in frontend" and "Use secure URLS in admin".
您网站上的链接现在都应为https.您可以使用以下规则来重定向为您的网站的http版本添加了书签的用户:
Links on your website should now all be https. You can use the following rule to redirect people that bookmarked the http-version of your site:
RewriteCond %{HTTPS} off RewriteRule ^ example%{REQUEST_URI} [R,L]在测试一切正常之后,将R标志更改为R=301.
Change the R flag to R=301 after testing everything works as expected.
更多推荐
将所有HTTP网址重定向到HTTPS以进行magento中的前端
发布评论