Forum Moderators: phranque

Message Too Old, No Replies

how can I make a 'catchall' page for a specific folder?

feed any request for a folder resource into the same page

         

s_mk

4:18 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



Hi,

I'm kinda new to Apache, but I need a way to configure requests for all page requests inside a specific folder to be directed to the same page regardless of what page is requested, yet preserving the url that was requested in the browser's address bar. Kinda like a 'catchall' page for only that folder. Key being to keep the url intact.

jdMorgan

12:43 am on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



s_mk,

Welcome to WebmasterWorld!

Apache mod_rewrite can be used to do this easily.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

To keep the original url, you are looking to do a "rewrite," and not a "redirect."

Jim

s_mk

9:40 pm on Oct 4, 2006 (gmt 0)

10+ Year Member



thanks!

I've got the catchall working well now, but I need to work with authentication as well, so I'm wondering if there is a way to have my cake and eat it too.

I'm working with a Plesk Control panel, and it kinda screws everything up. So although it tells you your setting an .htaccess file, in reality, its placing directives in a conf file for the whole domain. You can add additional directives into a vhosts.conf file, which is where I added the catchall rule.

but what I need is this:
no matter what the url is, send the request to the same page,
BUT
if it has 'admin' in the 1 hole of the path to require a valid-user

thanks again

jdMorgan

5:13 pm on Oct 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This sounds like a good use for a .htaccess file in the directory to be protected.

An alternative is to use a <directory> container in the httpd.conf, conf.d, or vhosts.conf file to make the password-checking dependent upon the requested directory.

Either way, it's unlikely that this level of configuration support will be available from a control panel, so it'll have to be doen with manual file edits.

Jim