宝塔面板设置Magento B2C程序伪静态规则和方法

一般正常情况下,我们在使用宝塔面板搭建的WEB环境系统有自带几十个常规CMS的伪静态规则,如果有需要的话直接选择对应的伪静态规则就可以生效。Magento作为外贸B2C建站程序用户比较多的CMS,居然在宝塔面板伪静态规则中没有找到Magento 程序支持的。

那遇到这个情况,我们如何设置Magento 的伪静态呢?

宝塔面板设置Magento B2C程序伪静态规则和方法

这里我们没有找到Magento伪静态规则

    location / {
            index index.html index.php; ## Allow a static html file to be shown first
            try_files $uri $uri/ @handler; 
            expires 30d;
        }
     
        location /var/export/ { ## Allow admins only to view export folder
            auth_basic           "Restricted"; ## Message shown in login window
            auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
            autoindex            on;
        }
          location  /. { ## Disable .htaccess and other hidden files
            return 404;
        }
     
        location @handler { ## Magento uses a common front handler
            rewrite / /index.php;
        }
     
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }

这里我们直接输入后,点击保存为模板。

宝塔面板设置Magento B2C程序伪静态规则和方法

我们保存之后,设置一个模板名称。保存提交之后,我们再选择Magento设置好的伪静态规则即可。

本文出处:老蒋部落 » 宝塔面板设置Magento B2C程序伪静态规则和方法 | 欢迎分享( 公众号:老蒋朋友圈 )

公众号 「老蒋朋友圈」获取站长新知 / 加QQ群 【1012423279】获取商家优惠推送