在没有htaccess的情况下,是否可以在wp functions.php中重写URL?我想将下面的代码转换为标准的wp重写规则。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteRule ^photo-gallery/surgical/(.*)/(.*)/(.*)/$ wp-content/themes/example-theme/surgical-photo-gallery-details.php?catid=$1&subid=$2&pid=$3```
1条答案
按热度按时间u3r8eeie1#
您可以将此代码块添加到主题的functions.php文件中。