.htaccess常用方法

时间:4年前   阅读:4914

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.qiquanji.com,我们将及时处理。

微信扫码关注

更新实时通知

上一篇:为什么很多期权专业投资者愿意去做卖方?

下一篇:shell记录用户的IP和命令

网友评论

请先 登录 再评论,若不是会员请先 注册