提问人:Devil Cloner 提问时间:11/15/2023 更新时间:11/15/2023 访问量:9
如何在 Wordpress 中使用 .htaccess 从主域 URL 或主页中删除尾部正斜杠
How to remove trailing forward slash from main domain URL or Home Page using .htaccess in Wordpress
问:
如果我得到从主页 URL 中删除尾部正斜杠的解决方案,我将不胜感激。
我正在使用自定义页面作为我网站的主页,并且主 URL 显示为“example.com/”,我想从我的主页 URL 中删除该正斜杠。
这是我目前的WordPress .htaccess
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I have tried with the wordpress settings :
**setting >> permalinks >> permalink structure >> custom structure >> /%postname%**
This method solves only to remove the post link forwarding slash from URL.
答: 暂无答案
评论