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/
精彩评论