RewriteEngine on
#请求替换
#test-zhangsan-20 替换为 test.php?name=zhangsan&age=20
RewriteRule test-([a-zA-Z]+)-([0-9]+)\.html$ test.php?name=$1&age=$2
#自定义错误页面
ErrorDocument 404 /error/404.php
ErrorDocument 503 /error/503.php
#IP禁止地址在123.45.67.8以及IP地址开头为123.123.7的任何人。例如123.123.74.42 就不能得到访问
Order allow,deny
Deny from 123.45.67.8
Deny from 123.123.7
Allow from all
#变更默认首页
DirectoryIndex homepage.html
#页面跳转
Redirect page1.html page2.html
转载于:https://www.cnblogs.com/mg007/p/10224621.html