.htaccess:使用智能筛选器清除url

.htaccess:使用智能筛选器清除url,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,花了2天时间从stackoverflow和其他网站混合和匹配规则,但没有运气,一部分可以工作,另一部分不能:(我想要类似“智能”规则的东西来过滤错误 example.com/user/或example.com/用户需要指向相同的位置,例如example.com/profile.php?viewuser&who=$1 问题:在我当前的设置中,当有尾随斜杠时,它只是循环到白色屏幕,所以我决定“手动”删除尾随斜杠。顺便说一下,当view Sourceed包含正确的html标记时生成的白色屏幕-它只

花了2天时间从stackoverflow和其他网站混合和匹配规则,但没有运气,一部分可以工作,另一部分不能:(我想要类似“智能”规则的东西来过滤错误

  • example.com/user/或example.com/用户需要指向相同的位置,例如example.com/profile.php?viewuser&who=$1
问题:在我当前的设置中,当有尾随斜杠时,它只是循环到白色屏幕,所以我决定“手动”删除尾随斜杠。顺便说一下,当view Sourceed包含正确的html标记时生成的白色屏幕-它只是没有显示,我不知道为什么

  • example.com/用户/notexistingurl必须抛出一个错误,但将保留example.com/级别的链接url结构
问题:我的被破坏到example.com/user/links.php,而不是example.com/links.php

顺便说一句,用户是一个变量,因此它可能需要simonsoft其他用户,等等。如果你看到我的网站没有任何问题,当我使用
标记时,它实际上是固定的。删除该标记会造成混乱。我正在找人对我下面的规则进行一些更正,然后可能不依赖
rewritebase
base
标记

这是我现有的.htaccess

Options -MultiViews
Options +FollowSymlinks
Options -Indexes

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]

# remove the trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R,L]

# Some "static" links
RewriteRule about$ 22688.html [NC,R,L]
RewriteRule privacy$ 77.html [NC,R,L]
RewriteRule terms$ 867.html [NC,R,L]
RewriteRule login$ index.php [NC,L]
RewriteRule logout$ logout.php [NC,L]
RewriteRule register$ register.php?do=regterm [NC,L]
# Quick login url
RewriteRule ^([a-zA-Z0-9\-_.]+):([^/]*)$ login.php?do=login&loguid=$1&logpwd=$2 [NC,L]

# The vanity url
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9\-_.]+)$ profile.php?do=viewuser&who=$1 [NC,QSA,L]
RewriteRule ^([a-z0-9\-_.]+)/friends$ profile.php?do=friends&who=$1 [NC,QSA,L]

感谢您的帮助。谢谢!

我不知道这里有关于
/messages/user
/messages/user/2
的任何规则。@anubhava我更新了这个问题,类似于/messages/user或/messages/user/2将适用于我发布的htaccess代码中的最后一行。我将继续讨论主要问题。
只有在使用时才能删除css、js、图像文件中的绝对路径,而不是相对路径。这意味着您必须确保这些文件的路径以
http://
或斜杠
/
@anubhava开头。简而言之,my.htaccess是正确的,但我需要在我的链接(例如
href=“/file.ext”)上预先添加
/
代替我现有的
href=“file.ext”
s?请确认,谢谢您的回答完全正确。