Web Servers on Unix and Linux - A unique htaccess config for an htaccess guru!

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > April 2006 > A unique htaccess config for an htaccess guru!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author A unique htaccess config for an htaccess guru!
rkeddie@gmail.com

2006-04-27, 7:24 am

Has this been done before or can it be done and if so can you tell me
how?

I have 10 different domains pointing at one specific server with its
own domain.
The only time people should be able to reach my server with those 10
domains is when there is a specific page it is going to...otherewise if
it is just the domain name as the url, I dont want them showing up at
site at all. So i want to redirect people that are using the root
address somewhere else but allow those using the root address with a
certain page..make sense? For instance:

Can i do this?:

Redirect www.domain1-10.com/ to http://www.maindomain.com/error.htm
(????)

So that if someone types in just www.domain1-10.com, they will not be
allowed but redirected to an error page but if they
go to a url such as www.domain1-10.com/catalog/prod19/index.htm...then
they
will allowed

Will such a redirect as I have above prevent the url www.domain1-10.com
working for anything at all even if it is a specific page access ?

I know...weird but I need this to be so.

Please advise anyone. If you could, give me the actual htaccess
configuration that will do this? Thankyou!

Peter Chant

2006-04-27, 7:24 am

rkeddie@gmail.com wrote:

> Has this been done before or can it be done and if so can you tell me
> how?
>
> I have 10 different domains pointing at one specific server with its
> own domain.
> The only time people should be able to reach my server with those 10
> domains is when there is a specific page it is going to...otherewise if
> it is just the domain name as the url, I dont want them showing up at
> site at all. So i want to redirect people that are using the root
> address somewhere else but allow those using the root address with a
> certain page..make sense? For instance:
>
> Can i do this?:
>
> Redirect www.domain1-10.com/ to http://www.maindomain.com/error.htm
> (????)
>
> So that if someone types in just www.domain1-10.com, they will not be
> allowed but redirected to an error page but if they
> go to a url such as www.domain1-10.com/catalog/prod19/index.htm...then
> they
> will allowed
>
> Will such a redirect as I have above prevent the url www.domain1-10.com
> working for anything at all even if it is a specific page access ?
>
> I know...weird but I need this to be so.
>
> Please advise anyone. If you could, give me the actual htaccess
> configuration that will do this? Thankyou!


How about

DirectoryIndex index.htm /error.htm

? I'm no guru.

That is part there, if they try anything does not match a file, or index.htm
then they will get error in the document root. Some sort of redirect is
still required.

--
http://www.petezilla.co.uk
phil-news-nospam@ipal.net

2006-04-27, 7:24 am

In comp.infosystems.www.servers.unix rkeddie@gmail.com wrote:

| Has this been done before or can it be done and if so can you tell me
| how?
|
| I have 10 different domains pointing at one specific server with its
| own domain.
| The only time people should be able to reach my server with those 10
| domains is when there is a specific page it is going to...otherewise if
| it is just the domain name as the url, I dont want them showing up at
| site at all. So i want to redirect people that are using the root
| address somewhere else but allow those using the root address with a
| certain page..make sense? For instance:
|
| Can i do this?:
|
| Redirect www.domain1-10.com/ to http://www.maindomain.com/error.htm
| (????)
|
| So that if someone types in just www.domain1-10.com, they will not be
| allowed but redirected to an error page but if they
| go to a url such as www.domain1-10.com/catalog/prod19/index.htm...then
| they
| will allowed
|
| Will such a redirect as I have above prevent the url www.domain1-10.com
| working for anything at all even if it is a specific page access ?

I have not tested this for what you are doing, but I have used this
directive for some other things. This could be in the virtualhost
section of httpd.conf, or should work in .htaccess too.

RedirectMatch permanent ^/$ http://main.domain.to.see/whatever.html

You might want to also do:

RedirectMatch permanent ^/default\..* http://main.domain.to.see/whatever.html
RedirectMatch permanent ^/index\..* http://main.domain.to.see/whatever.html

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com