Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: open
AddType text/x-server-parsed-html .html
RewriteRule ^(.*)\.html$ cgi-bin/cloak.pl?name=$1.html [T=application/x-httpd-cgi,L]
RewriteRule ^(.*)\.htm$ cgi-bin/cloak.pl?name=$1.htm [T=application/x-httpd-cgi,L]
What I want is to get the request for the page to go through the script..
But I get "Page not found" for any .htm or .html file request. Although, seems like Rewrite directive is allowed ( error log stays the same)
So, something wrong with that, but what???
Would be greatly appreciate for that!
AddType application/x-httpd-cgi .htm
Now just name the script as the pagename-you-want.htm and it will execute. But some of this depends on how your script retrieves pages. Are they inline? i.e. is the HTML source code embedded in the script or does the script read the pages to display from a file? The example here is for a script with inline HTML source.
In your .htaccess file add the following:
AddHandler server-parsed .htm
In the pagename-you-want.htm have the single SSI statement:
<!--# include virtual = "/cgi-bin/cloak.pl?name=pagename-you-want.htm" -->
The AddHandler statement in your .htaccess allows files with .htm extension to be server parsed. The SSI statement will call the script and execute it, passing the parameter name=pagename-you-want.htm
Also remove the AddType application/x-httpd-cgi .htm statement from your .htaccess, you shouldn't need it.