URL重写的若干非mod_rewrite方法
URL重写的若干非mod_rewrite方法特此留念
1、Alias:重写到本地路径
可以使用Alias把一个指定的Url重写到某一固定的本地路径
Alias /test/ /home/www/test/
那么对[url=http://..../test/]http://..../test/[/url] 将对应了/home/www/test/
注意:Alias必须是一一对应的,/test/将不对/test起作用。
2、AliasMatch:重写到本地路径
与Alias类似,但是可以使用正则表达式
AliasMatch ^/test(.*) /home/www/test$1
3、Redirect :重写到网址
Redirect /test/ [url=http://....../test2/]http://....../test2/[/url]
4、RedirectMatch :重写到网址
与Redirect类似,但是可以使用正则表达式
Redirect /test(.*) [url=http://....../test2$1]http://....../test2$1[/url]
在不需要很复杂的URL重写时,完全可以使用以上的几条指令来进行。
图片附件:
HonestQiao_Topic_6999.jpg (2005-9-23 23:50, 122.71 K)
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" onmousewheel="return imgzoom(this);">
[[i] 本帖最后由 shirenniao 于 2006-8-14 10:35 编辑 [/i]]
页:
[1]