学习Apache的mod rewrite、access写法

Apache 的 mod rewrite
RewriteEngine On RewriteBase /B2B/website/ RewriteRule ^article-([0-9]+).html$ view_details.php?browse=profile&id=$1
以上这个测试通过的。如果不行关键是服务器端,以后的怎么改就发挥了
关于图片的 可以加一个 /503(id)/title.htm 这样一定不重复了,用503或其他数字或者是abc也行,不顾oabc还想不是很理想,学学ii的,他就是用数字的定义所有的功能就行了

这个很有参考价值的
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/archiver/((fid|tid)-[w-]+.html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
RewriteRule ^(.*)/space-(username|uid)-(.+).html$ $1/space.php?$2=$3
RewriteRule ^(.*)/tag-(.+).html$ $1/tag.php?name=$2
</IfModule>
discuz的
最强wordpress的
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
关键看看 %怎么用了 还有 [...]

参与评论