Forum Moderators: phranque
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.
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
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
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