配置WordPress在Zeus服务器重写规则

配置WordPress在Zeus服务器重写规则,rewrite.script 如下:

RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if there are any queries in our URL
match URL into $ with ^(.*)?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for the file, rewrite if it is not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index. don’t rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?q=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

#  https://www.zuimoban.com/wordpress/tutorials/63.html

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with ?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:





相关文章

  1. 让woocommerce将产品标题设置为产品图片的

    woocommerce图像标题和alt标签对SEO至关重要,更改每个图像标题和alt标签将花费很长时间。一般优化我们会在函数当中加载代码: add_filter(wp_get_attachment_image_attributes, change_attachement_image_a...

    2020-02-29
  2. 阻止恶意URL请求错误查询BBQ脚本代码

    阻止恶意URL请求错误查询BBQ是一个简单的脚本,可保护您的网站免遭恶意URL请求。检查所有传入流量,并悄阻止掉一些恶意请教代码eval(,base64_和过长请求字符串。这是一个简单而可靠...

    2020-04-13
  3. 用户在WooCommerce访问时自动将产品添加到

    实现用户在WooCommerce访问时自动将产品添加到购物车代码: /** * 用户在WooCommerce访问时自动将产品添加到购物车zuimoban.com */add_action( template_redirect, add_product_to_cart );function add_product_to_car...

    2021-07-31
  4. 配置WordPress在Zeus服务器重写规则

    配置WordPress在Zeus服务器重写规则,rewrite.script 如下: RULE_0_START:# get the document rootmap path into SCRATCH:DOCROOT from /# initialize our variablesset SCRATCH:ORIG_URL = %{URL}set SCRATCH:REQUEST_URI = %{URL}# see if th...

    2021-07-31
  5. WooCommerce创建新帐户时通知管理员代码

    WooCommerce创建新帐户时通知管理员代码 /** * Notify admin when a new customer account is created */ add_action( woocommerce_created_customer, woocommerce_created_customer_admin_notification ); function woocommerce_created_custome...

    2021-07-31
  6. 限制WooCommerce购物车最低付款金额

    限制WooCommerce购物车最低付款金额,实现代码如下: /** * Set a minimum order amount for checkout source by zuimoban.com */add_action( woocommerce_checkout_process, wc_minimum_order_amount );add_action( woocommerce_before_ca...

    2021-07-31