Author |
|
iamwyza
Joined: 16 May 2007 Posts: 15
|
Posted: Tue 17 Jul '07 13:48 Post subject: Forcing all Non-CGI Files to be wrapped |
|
|
I don't know if this is possible but here is what I would like to do.
Tell the server that if the file it is handling is not a CGI file then it needs to pass the dir/name of the file to this CGI wrapper which will handle it from there, however i want the url to still show the page as though you were looking at the file directly, not through the wrapper.
ex:
http://yoursite.com/help/ohno.html
apache sees its not a cgi and says
http://yoursite.com/wrapper.cgi?help/ohno.html
but the user sees
http://yoursite.com/help/ohno.html
TiA |
|
Back to top |
|
iamwyza
Joined: 16 May 2007 Posts: 15
|
Posted: Tue 17 Jul '07 13:50 Post subject: |
|
|
oh, and we are running apache 2.0.x |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 17 Jul '07 13:59 Post subject: |
|
|
You could use mod_rewrite or adding the handler to html files.
AddHandler cgi-script .html |
|
Back to top |
|
iamwyza
Joined: 16 May 2007 Posts: 15
|
Posted: Tue 17 Jul '07 14:20 Post subject: |
|
|
If i understand the limited documentation AddHandler function it simply tells it to use the cgi engine to handle the file which is sadly not enough. I need it to be calling my authentication bit before it serves the page to make sure the user is supposed to be getting the page.
I considered mod_rewrite, but i am not a rewrite guru. I reading through a rewriting guide i see where you could tell .html as .cgi but that still doesn't solve my problem. It basically leads itself to needing to modify all the .html to have CGI in them which i don't want.[/code] |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 17 Jul '07 15:09 Post subject: |
|
|
As I said, use mod_rewrite
There are a lot of examples on that page.
like
Code: |
RewriteRule ^/help/([^/]*) /wrapper.cgi?help/=$1 [PT]
|
|
|
Back to top |
|
iamwyza
Joined: 16 May 2007 Posts: 15
|
|
Back to top |
|