Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an account where hundreds of inbound links to their calender are showing up as 404 (they moved their site to a new platform). I would like to make a wildcard redirection of all URLs with a query to their old event calender to land on a new static page, and do the same for their webstore queries. I've tried several variations, but can't seem to get it to work.

CASE 1: I need to redirect URLs like these (note the difference between "showDay" and "showWeek"):

apps/calendar/showWeek?calID=5107976&year=2011&month=7&day=10 apps/calendar/showDay?calID=5107976&year=2011&month=9&day=10

To:

http://domain.com/events/

CASE 2: And also URLs like these:

apps/webstore/products/show/1927074

TO: http://subdomain.domain.com/

I can't seem to get the syntax right to take all of the URLS and redirect them. I'm looking for the equivalent of a wildcard like "apps/calendar/*" would give you at a command line.

Any help is appreciated!

share|improve this question

2 Answers 2

Thank you very much! You definitely helped me!

I did have to add a question mark at the end of the domain I'm redirecting to in order to strip out the query:

    RedirectMatch Permanent apps/calendar/?.* http://domain/com/events/?
    RedirectMatch Permanent apps/webstore/?.* http://subdomain.domain.com/?
share|improve this answer

For the calendar URLs:

RedirectMatch Permanent apps/calendar/?.* http://domain/com/events/

And the webstore:

RedirectMatch Permanent apps/webstore/?.* http://subdomain.domain.com/

You don't need rewrites.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.