那个大侠知道htaccess里写的是啥可以url不?
Options -MultiViews +FollowSymlinks -Indexes#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
# MediaTemple, it is known to cause random Internal Server
# errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
# Turn off mod_security filtering.
SecFilterEngine Off
# The below probably isn't needed, but better safe than sorry.
SecFilterScanPOST Off
</IfModule>
#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
# the setting enabled in the Admin CP and you have this file
# named .htaccess
#
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^forum-(+)\.html$ forumdisplay.php?fid=$1
RewriteRule ^forum-(+)-page-(+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-(+)\.html$ showthread.php?tid=$1
RewriteRule ^thread-(+)-page-(+)\.html$ showthread.php?tid=$1&page=$2
RewriteRule ^thread-(+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost
RewriteRule ^thread-(+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest
RewriteRule ^thread-(+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest
RewriteRule ^thread-(+)-newpost\.html$ showthread.php?tid=$1&action=newpost
RewriteRule ^thread-(+)-post-(+)\.html$ showthread.php?tid=$1&pid=$2
RewriteRule ^post-(+)\.html$ showthread.php?pid=$1
RewriteRule ^announcement-(+)\.html$ announcements.php?aid=$1
RewriteRule ^user-(+)\.html$ member.php?action=profile&uid=$1
RewriteRule ^calendar-(+)\.html$ calendar.php?calendar=$1
RewriteRule ^calendar-(+)-year-(+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2
RewriteRule ^calendar-(+)-year-(+)-month-(+)\.html$ calendar.php?calendar=$1&year=$2&month=$3
RewriteRule ^calendar-(+)-year-(+)-month-(+)-day-(+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4
RewriteRule ^calendar-(+)-week-(n?+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2
RewriteRule ^event-(+)\.html$ calendar.php?action=event&eid=$1
<IfModule mod_env.c>
SetEnv SEO_SUPPORT 1
</IfModule>
</IfModule>
#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>
这个文件里是关于服务器的 Rewrite 规则设置
概述来说,htaccess文件是Apache服务器中的一个配置文件,它负责相关目录下的网页配置。通过htaccess文件,可以帮我们实现:网页301重定向、自定义404错误页面、改变文件扩展名、允许/阻止特定的用户或者目录的访问、禁止目录列表、配置默认文档等功能。 Unix、Linux系统或者是任何版本的Apache Web服务器都是支持.htaccess的,但是有的主机服务商可能不允许你自定义自己的.htaccess文件。国内的大多数虚拟主机就没有这个功能。我所知道的提供这个功能的有康盛世纪(就是Discuz的论坛服务商)。 启用.htaccess,需要修改httpd.conf,启用AllowOverride,并可以用AllowOverride限制特定命令的使用。如果需要使用.htaccess以外的其他文件名,可以用AccessFileName指令来改变。例如,需要使用.config ,则可以在服务器配置文件中按以下方法配置:AccessFileName .config 。 笼统地说,.htaccess可以帮我们实现包括:文件夹密码保护、用户自动重定向、自定义错误页面、改变你的文件扩展名、封禁特定IP地址的用户、只允许特定IP地址的用户、禁止目录列表,以及使用其他文件作为index文件等一些功能。 有点像discuz的重写规则啊 这是MYBB的.. 回复 金光 的帖子
有点明白了!
页:
[1]