如何删除从phpBB的网址斜线? [英] How to remove a trailing slash from phpBB url?

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

问题描述

我跟一些previously回答了有关问题在这里,并改写了我的phpBB论坛的主要网址如下:

I have followed some previously answered questions on here and rewrote my phpBB forum's main URL as follows:

Options +FollowSymLinks -MultiViews

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
RewriteRule ^ /%1 [R=301,L]

曾经是本次论坛的网址

The forum URL used to be

http://site.com/forum/index.php

现在它成功地解析为

http://site.com/forum/

我想删除最后结尾的斜线。我应该做的code以上什么样的变化?

I would like to remove the final trailing slash. What changes should i make to the code above?

P.S。我需要做出类似修改同一个站点,目前解析为site.com/wiki/index.php?title=Main_Page(我需要它是site.com/wiki)

P.S. I would need to make similar changes to the wiki page of the same site, which currently resolves to site.com/wiki/index.php?title=Main_Page (I need it to be site.com/wiki)

推荐答案

在你的.htaccess的重写规则之前加入这一行:

In your .htaccess before your rewrite rule add this line:

DirectorySlash Off

要告诉Apache不是总要追加斜线。

to tell Apache to not to always append a trailing slash.

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

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