views:

670

answers:

1

Hey everyone,

I am trying to redirect ALL requests for mydomain.com whether they are something like:

to be redirected to

As long as it has mydomain.com in it, they should see this page - its a we'll be back soon message.

Whats the best way to do this - .htaccess or right in the conf?

Thanks,

+2  A: 

I actually ended up finding the answer on ServerFault:

http://serverfault.com/questions/32513/url-redirect-to-another-page-on-the-same-site

"This example will 301 redirect all URLs to "/underconstruction.html":

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/underconstruction.html
RewriteRule ^ /underconstruction.html [R=301]

(which translates as "If URI is not /underconstruction.html, redirect to /underconstruction.html")" - Tommeh

barfoon