开发者

Using htaccess to rewrite a URL

I want to change the URL of two specific pages in my application:

app.mysite.com/thanks/type/b/ changes to app.mysite.com/thanks/buyer/

and

app.mysite.com/thanks/type/s/ changes to app.mysit开发者_C百科e.com/d/thanks/supplier/

What would be the appropriate rewrite statement?


RewriteRule ^thanks/type/b/?$ thanks/buyer/
RewriteRule ^thanks/type/s/?$ d/thanks/supplier/


The follow should do what you want and allows an optional trailing slash, (i.e. /thanks/buyer or /thanks/buyer/)

RewriteEngine On
RewriteBase /

RewriteRule ^thanks/buyer/?$ /thanks/type/b/
RewriteRule ^d/thanks/supplier/?$ /thanks/type/s/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜