homepage Welcome to WebmasterWorld Guest from 54.205.160.82
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Marketing and Biz Dev / Cloaking
Forum Library, Charter, Moderator: open

Cloaking Forum

    
Need help on rewrite!
Please, help with that.
NeoN




msg:679715
 8:23 pm on Dec 16, 2001 (gmt 0)

I have a problem with the cloaking script set up.. With no specific titles.:)
I place the following to the .htaccess file.:

AddType text/x-server-parsed-html .html

RewriteEngine on
RewriteBase /
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!
Thank you!

 

Air




msg:679716
 5:52 am on Dec 17, 2001 (gmt 0)

You don't really need the rewrite, the line in .htaccess to make a file named with a .htm extension be treated as a .cgi is as follows:

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.

NeoN




msg:679717
 5:59 am on Dec 17, 2001 (gmt 0)

Thanks, Air. But they are not inline. I want the solution to cloak the site, although the pages are in usual files easy for updating. The script takes the file as the parameter .. Then checks for the IP. If that is the SE (Google), then it takes the same file from the directory /Google/.
I mean, for example, you accessed the index.html file.
That goes like /cgi-bin/cloak.pl?name=index.html
The script checks the IP and takes the index.html from the right directory.
It just Opens and prints the file..
Makes sense???
Would be greatly appreciate for that!

Thank yoU!

Air




msg:679718
 2:32 pm on Dec 17, 2001 (gmt 0)

Ok, then try this (hope you have SSI available).

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Marketing and Biz Dev / Cloaking
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved