0

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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