Forum Moderators: phranque

Message Too Old, No Replies

Need Redirect Help

         

kposs

6:07 pm on Jun 7, 2008 (gmt 0)

10+ Year Member



Hi,

I am running Apache 1.3.20 on a Linux machine. This machine is a dedicated list server, therefore we do not have any virtual hosting set up. All domains on the machine are set up in their respective DNS with A records that point to the machine IP number. As a list server, clients usually link or go directly to the list web interface. For example,

[list.example.com...]

I need to put in a redirect for all domains on the machine (now and future) for anyone that goes to the root of a domain. So, I need:

[list.example.com...]

OR

[list.example.com...]

to redirect to

[list.example.com...]

I tried some things and ended up with an infinite loop :) I'm kind of new to Apache specifically but have been in web hosting over 12 years. Still, you'll have to confirm if any suggestions you have go in the httpd.conf file.

thanks,

Valerie

P.S. I have a request from a client to disable directory browsing for /manual/mod, /manual, and /icons. I haven't searched for this one yet, but if you know how to do it easily, I'd appreciate your help there too!

[edited by: jdMorgan at 4:06 pm (utc) on June 8, 2008]
[edit reason] example.com [/edit]

jdMorgan

4:05 pm on Jun 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I tried some things and ended up with an infinite loop...

Please post your best-effort code as a basis for discussion. For more info, see our Forum Charter (link at top left of this page).

Thanks,
Jim

kposs

7:30 pm on Jun 8, 2008 (gmt 0)

10+ Year Member



Sorry, I don't have any code. The code I tried was for something else and I have not found any code to even try for this situation (redirecting all domains). If that is not acceptable, just let me know and I'll ask for help elsewhere.

g1smd

9:49 pm on Jun 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you sure you need a redirect to do this?

Why not a rewrite, so that you don't expose the internal filepath while operating the script?

kposs

10:22 pm on Jun 8, 2008 (gmt 0)

10+ Year Member



No, I'm not sure that a redirect is the best option. That is what I would call the 'process' based on my Mac web hosting experience. The actual 'code' on Apache to achieve that result might be something different.

thanks,

Valerie

jdMorgan

9:50 pm on Jun 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you want to internally rewrite root requests for the "lists" subdomain of all domains to /cgi-bin/lyris.pl, and this is *not* a redirect. An alternative is to set up separate VirtualHost containers for the "lists: subdomains, and set the DirectoryIndex for each to /cgi-bin/lyris.pl

Jim

kposs

10:25 pm on Jun 9, 2008 (gmt 0)

10+ Year Member



Thanks, I'll work on that.

kposs

1:32 am on Jun 10, 2008 (gmt 0)

10+ Year Member



I ended up using the following:

<VirtualHost *>
DirectoryIndex /cgi-bin/lyris.pl
</VirtualHost>

Works like a charm!

thanks,

Valerie