You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mseethar <ms...@employees.org> on 2004/05/07 13:15:05 UTC

[users@httpd] Single file to be served irrespective of the url

Hi folks,
	I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?

Thanks,
  - Madhu


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Single file to be served irrespective of the url

Posted by Aurélien DEHAY <au...@ext.anpe.fr>.
mseethar wrote:
> Hi folks,

Hello.

> 	I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?

Use 404 document error for serving this file

Rgds.

-- 
Aurélien DEHAY



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Single file to be served irrespective of the url

Posted by Chris <li...@leftbrained.org>.
I have a Server which all the content pages are being handled through a
single php file, except for javascript,css, and images. This is what the
config looks like:

AliasMatch  ^/(js|css|images)/(.*) /usr/local/apache/vhosts/admin/root/$1/$2
AliasMatch  ^/(.*)$
/usr/local/apache/vhosts/admin/root/main.php/$1

if the URL starts with /js/ ,/css/, or /images/ It will just pass it
through. You could have any number of these before your all-encompassing
AliasMatch.

I really don't *know* that this is the best thing. I'm not familiar with
mod_rewrite overhead as opposed to mod_alias overhead, though it seems that
AliasMatch would be faster than mod_rewrite, even though it does a regular
expression match every request.

Chris

-----Original Message-----
From: Tim Burden [mailto:tim@burden.ca]
Sent: Friday, May 07, 2004 9:29 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Single file to be served irrespective of the
url


Hi Chris,

That one looks interesting. Is it better than the mod_rewrite option? And,
is there an easy way to make it NOT apply to certain files, as in

RewriteEngine on
RewriteCond %{REQUEST_URI} !/photo.php
RewriteRule .* index.php

----- Original Message -----
From: "Chris" <li...@leftbrained.org>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 11:20 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url


> AliasMatch  ^(.*)$ /usr/local/apache/htdocs/catalog.html
>
> Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
> since those send Error headers as well.
>
> Chris
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 4:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
>   - Madhu
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Single file to be served irrespective of the url

Posted by Tim Burden <ti...@burden.ca>.
Hi Chris,

That one looks interesting. Is it better than the mod_rewrite option? And,
is there an easy way to make it NOT apply to certain files, as in

RewriteEngine on
RewriteCond %{REQUEST_URI} !/photo.php
RewriteRule .* index.php

----- Original Message ----- 
From: "Chris" <li...@leftbrained.org>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 11:20 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url


> AliasMatch  ^(.*)$ /usr/local/apache/htdocs/catalog.html
>
> Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
> since those send Error headers as well.
>
> Chris
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 4:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
>   - Madhu
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Single file to be served irrespective of the url

Posted by Chris <li...@leftbrained.org>.
AliasMatch  ^(.*)$ /usr/local/apache/htdocs/catalog.html

Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
since those send Error headers as well.

Chris

-----Original Message-----
From: mseethar [mailto:mseethar@employees.org]
Sent: Friday, May 07, 2004 4:15 AM
To: users@httpd.apache.org
Subject: [users@httpd] Single file to be served irrespective of the url


Hi folks,
	I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?

Thanks,
  - Madhu


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Single file to be served irrespective of the url

Posted by Tim Burden <ti...@burden.ca>.
Using mod_rewrite:
RewriteEngine on
RewriteRule .* catalog.html

Using Redirect:
RedirectMatch .* http://yoursite/catalog.html
(very inefficient)

But using the custom ErrorDocument as suggested is possibly most efficient.
----- Original Message ----- 
From: "John Ellingsworth" <je...@mail.med.upenn.edu>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 8:55 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url


> Are you using a scripting language?
>
> You could write (depending on your script language)
>
> If (!($thispage)) == "catalog.html"
> {
> <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://mywebsite/catalog.html">
> }
>
> I unfortunately don't know the apache answer :(
> Sorry.
>
> Thanks,
>
> John Ellingsworth
> http://mail.med.upenn.edu/~jellings/
> AIM: vc2000support
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 7:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
>   - Madhu
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Single file to be served irrespective of the url

Posted by John Ellingsworth <je...@mail.med.upenn.edu>.
Are you using a scripting language?

You could write (depending on your script language)

If (!($thispage)) == "catalog.html"
{
	<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://mywebsite/catalog.html">
}

I unfortunately don't know the apache answer :(
Sorry.

Thanks,

John Ellingsworth 
http://mail.med.upenn.edu/~jellings/
AIM: vc2000support

-----Original Message-----
From: mseethar [mailto:mseethar@employees.org]
Sent: Friday, May 07, 2004 7:15 AM
To: users@httpd.apache.org
Subject: [users@httpd] Single file to be served irrespective of the url


Hi folks,
	I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?

Thanks,
  - Madhu


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org