Remove slugs and redirect using htaccess
Using .htaccess, how can I strip parameters from a url and redirect an entire folder to another location?
For example, I have http://www.webbiscuit.co.uk/News.aspx/11/favicon-competition
and I just want to redirect this to http://www.webb开发者_如何学Goiscuit.co.uk/
.
I have tried
Redirect 301 /News.aspx http://www.webbiscuit.co.uk/
but that just strips off the News.aspx
part, and redirects me to
http://www.webbiscuit.co.uk/11/favicon-competition
How can I strip off the entire file and the slugs?
Using mod_rewrite (the ?
may be unnecessary here):
RewriteRule ^News\.aspx(.*) http://www.webbiscuit.co.uk/? [NC,R=301,L]
精彩评论