How to setup a general 301 redirect that will ignore the ending url string

95 views Asked by At

Is there a way to make any redirect that redirect based on the start of the URL? for example I would like this URL and all others like it ( the /57/userid/25516 is always different numbers).

http://www.example.com/site/ActivityFeed/MyProfile/tabid/57/UserId/25516/Default.aspx

To redirect based on (regardless of the following part of the URL string)

http://www.example.com/site/ActivityFeed/MyProfile/*will redirect no matter what else the string contains/

This would be amazingly helpful if someone knows the answer. Thank a lot guys.

1

There are 1 answers

0
tisantisan On BEST ANSWER

I'm having some trubles understanding where do you want to redirect it to. So this should redirect to http://www.example.com/site/. I think it might be what you want:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^site/ActivityFeed/MyProfile site/ [R=301,L,NC]

Try it out and let me know