Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 将ulrs中的vbulletin缩小至尽可能小_.htaccess_Mod Rewrite_Vbulletin - Fatal编程技术网

.htaccess 将ulrs中的vbulletin缩小至尽可能小

.htaccess 将ulrs中的vbulletin缩小至尽可能小,.htaccess,mod-rewrite,vbulletin,.htaccess,Mod Rewrite,Vbulletin,我试图在管理员cp中使用vbulletin友好的url选项,以使论坛的url尽可能小,以便访问者记住,但无法实现我的目标 好吧,我只想让所有长URL都短于此: www.myforum.com/en/threads/1220-my-topic-about-moon 为此: www.myforum.com/en/thr1220 因此,基本上我想跳过单词threads并添加thr,例如在url的末尾+线程编号,而不列出线程标题 以下是我从vbulletin中获得的.htaccess代码,我认为这是修改

我试图在管理员cp中使用vbulletin友好的url选项,以使论坛的url尽可能小,以便访问者记住,但无法实现我的目标

好吧,我只想让所有长URL都短于此:

www.myforum.com/en/threads/1220-my-topic-about-moon

为此:

www.myforum.com/en/thr1220

因此,基本上我想跳过单词threads并添加thr,例如在url的末尾+线程编号,而不列出线程标题

以下是我从vbulletin中获得的.htaccess代码,我认为这是修改的起点:

RewriteEngine on


# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/


# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
# Options -MultiViews


RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d


RewriteRule ^.*$ - [NC,L]


# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]


RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d


RewriteRule ^.*$ - [NC,L]
你知道如何更改或修改这段代码来实现我的目标吗


感谢

看起来vBulletin正在内部处理这些内容,线程只需路由到
showthread.php
,而无需任何外部操作,因此如果更改URL的结构,
showthread.php
可能无法工作。可能有一种方法可以重新配置vBulletin以处理新的URI结构,但是如果您查看上面的代码,您会注意到它们将showthread.php转换为任何替换该结构的单词。所以我相信一定有办法做到这一点。我在一些论坛上看到过,好吧,如果你坚持这个例子,看看这里:发生了什么,showthreads.php已经被转换成线程,论坛页面的其他部分也被转换成了forumdisplay.php。这意味着是的,可以缩短url并仅用字符串替换某些链接……”可能,但如果您查看上面的代码,您会注意到它们将showthread.php转换为任何替换该url的单词。“是的,这正是我所说的。脚本可能通过解析
$\u服务器['script\u URL']
$\u服务器['REQUEST\u URI']
变量来获取重要的位,如线程ID(例如1220)。这意味着,如果您只是将
/en/thr1220
发送到
showthread.php
,它可能无法解析它。是的,您是对的。我只是试了一下,但没有成功。我很想知道这是如何改变的。。。谢谢你的宝贵意见