Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internal redirection w. Apache

Status
Not open for further replies.

Masali

Programmer
Jun 19, 2002
143
SE
I want to do an internal redirect. If a user types in eg. in the browser, I want Apache to request instead. I know this is possible with
RewriteRule ^(.*)$
But I want it to be invisible to the surfer. The URL that was typed in the browser ( should still be visible for the surfer.

So, I don't want Apache to send a 302 Moved but a standard 200 OK and just doing an internal redirect.

Also if possible, I only want to do this when the "file" does NOT exist. Eg. if is called and the file "hello.html" exists it should load as usual.

Please advice and thanks in advance

Masali
 
Apologies if I'm missing something obvious; I've been up a long, long time. :)

Is there a reason you can't use mod_perl's internal_redirect_handler?

Basically, you'd set up a module as a PerlTransHandler in your httpd.conf, and that module would have some way of knowing what "real" file you want to return for what user-request (You can do it with hashes, db tables, shared mem, etc), and does a internal_redirect_handler($realfile).

Hope this helps,
CM
 
I am not an expert in this matter, so please explain a bit more. This could be what I am looking for. Is it possible to make this from a htaccess to?

Thanks in advance

Masali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top