删除斜杠从网站中的所有网址 [英] Removing trailing slash from ALL URLs in site

查看:231
本文介绍了删除斜杠从网站中的所有网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一种新的对整个htaccess的事情,我一直在试图修改它,以便没有我的联系将有尾随斜线在各自网址的结尾。我的网站是filmblurb.org。

I'm kind of new to the whole .htaccess thing and I've been trying to modify it so that none of my links will have trailing slashes at the end of their respective URLs. My website is filmblurb.org.

在$ C $下,其中的Word preSS的开始和结束看起来像这样的.htaccess:

The code for the .htaccess where Wordpress begins and ends looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

我会AP preciate,如果有人可能会导致我在正确的方向上如何解决这一问题。谢谢你。

I would appreciate it if someone can lead me in the right direction on how to fix this. Thanks.

推荐答案

您可以添加一个重写规则,以消除结尾的斜线:

You can add a RewriteRule to eliminate the trailing slash:

RewriteRule ^(.*)/$ $1 [R=301,L]

这篇关于删除斜杠从网站中的所有网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆