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 inherited a server with a couple of domains on it. The website was reworked within the last two years and I am trying to oblige a request by staff to get a redirect to work properly (if it can given the default structure).

So right now on the server I have a redirect that takes every 301 and dumps it onto the front page of the website.

RedirectMatch /(.) http://www.example.com

This has worked well for most of the old URL's coming in from various websites containing the old liking structure.

However, now a staff member wants a single URL which is somewhat widely used to be redirected to it's proper place.

Redirect /new/research/Exp_Rese_Disc/Asia/example.shtml http://example.com/asia/

Is this possible without killing the all encompassing 301 redirect?

To have a general RedirectMatch /(.) redirect as well as a singular redirect?

As of right now it is not seeming to let me. Any ideas, thoughts or examples are much appreciated.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You might consider switching to RewriteConf/RewriteRule pairs, it's easier to control the flow of logic.

For instance:

RewriteEngine  on
RewriteCond %(REQUEST_URI) ^/new/research/example.shtml$ [NC]
RewriteRule ^(.*)$ http://example.com/asia [R=301,L]

RewriteCond %(REQUEST_URI) /(.)
RewriteRule ^(.*)$ http://example.com [R=302]

#Drop the www
RewriteCond %(HTTP_HOST) !^example.com$ [NC]
RewriteRule ^(.*)$ http://example.com$1 [R=301]

or something along those lines... Apache has several good references on it.

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.