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

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

 





Justin Pasher wrote:
> 
> MierMier wrote:
>> Hey people, I need your help, thanks in advance!
>>
>> 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?
>>
>> Thanks again
>>
>> Lior.
> 
> A RewriteRule that performs an internal rewrite should give you what you 
> need
> 
> RewriteEngine on
> RewriteRule ^/hello/index.php$ /a.php [L]
> 
> By default, the rewrite will perform an internal rewrite, as opposed to 
> a 301/302 redirect. If the setup is a little more complex than what you 
> describe above, then it may require some additional rules (such as 
> redirecting a request for ANY arbitrary file that does not exist). You 
> can explore the "RewriteCond -f" directive to make it smarter in that
> case.
> 
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
> 
> 
> -- 
> Justin Pasher
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 

Hi paul,

I tried to read this guid and it seems to be a bit complicated... can you
maybe help me out a bit?

Le'ts take the example I wrote above.

If I go to /a/page1.php?c=1
Or I go to /a/page6.php?c=3&d=4

and I want the server to output a.php's content while he also recives the
GET request arguments of page1/2..

How (the hell hehe) do I do that?

Thanks in Advance!



-- 
View this message in context: http://www.nabble.com/Apache-server---Output-to-the-same-page-whatever-request-tp19904387p19909806.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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