Re: Apache server - Output to the same page whatever request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/08, MierMier <liormin@xxxxxxxxxxxx> wrote:
>  MierMier wrote:
>  > I have an appche server 2.x. + PHP, And I woundered rather it is possible
>  > to output the same page (i.e. "a.php") for a request of whatever page.
>  >
>  > I will give an examples:
>  > if the client try to reach "/hello/index.php" (which do not really exist
>  > in the server)
>  >
>  > Can apache just tell the client -> I return you that page
>  > (/hello/index.php) but infact, this page's content is "a.php"'s content.
>  > wiout 404 Errors and stuff?
>  > Lior.
>
> Well thanks alot, but somhing went wrong, and after reading, still can't
>  understand why.
>
>  I have an Apache server server on my PC, based on WinXP,
>  and when I use these in .htaccess
>  Options +FollowSymLinks
>  RewriteEngine On
>  RewriteRule ^.*$ /a.php [QSA]
>
>  it works well.
>  How ever at my Linux apache server server it doesn't, it always show me 404
>  error, and the rewrite mod is enabled.
>
>  Any ideas?

The querystring is passed to redirected pages by default if the
redirect does not contain a question mark.  Ending with a querystring
overwrites the querystring with the new values.  Ending the redirect
with a question mark clears the original values -- no new values. The
QSA (QueryString Append) option merges new querystring values with the
original values, unecessary without new querystring values  See
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Status 404 is "Not Found".  Does /a.php exist?  Can httpd read it?
File permission issues?

Redirecting error pages may not require a RewriteRule or even
mod_rewrite.  "ErrorDocument" is a core command.  Try:
   ErrorDocument 404 /a.php
The documentation does not mention how ErrorDocument handles the
original querystring. See:
http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

HTH,
solprovider

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux