Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-09-2005 11:50:00

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 929
Website

How Do We Hide Url Cgi Name & Parameters?

We are seeking a method to hide the name of the script and its parameters in the address bar. This is for security reasons.

We are on an Apache server.

Two methods we thought of are to
(1) Use a frameset or
(2) Send the url to the address bar with something like a Javascript location.replace command. (I don't know if this would redirect the page.)

Q. Isn't there a way that Perl can do this? Are there any other ways that are more logical to use?

If so, please provide example script and where to place it.

Any and all suggestions are welcomed.


W e b s i t e  E n g i n e e r i n g,   D e s i g n   &   M a n a g e m e n t
Knowledgeable, Experienced, Effective, Available ~ Reasonable prices
wwwBoulderWebsiteEngineering.com

Fast Servers & Reliable Hosting! Reasonable prices.
wwwEZP.net

And, Free Tibet!

Offline

 

#2 01-09-2005 12:36:41

superhero2000
Member
From: Harrisburg, PA
Registered: 03-26-2003
Posts: 1025
Website

Re: How Do We Hide Url Cgi Name & Parameters?

Try using mod_rewrite rules, there are a few posts on this subject, do a search or install ATS SEO module.


Vinh
VQC Designs, LLC


Offline

 

#3 01-11-2005 12:02:35

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19124
Website

Re: How Do We Hide Url Cgi Name & Parameters?



Q. Isn't there a way that Perl can do this? Are there any other ways that are more logical to use?

Technically, there is. 

(1) Assuming this setup:

- You have a media directory at /home/acct/www/ccp51/media
- That media directory is world writable (chmod 777)
- You create a sub-directory in there called 'html' so you have /home/acct/www/ccp51/media/html

In the file ./cgi-bin/cp-app.cgi, look for:

Code:


&initialize;

Replace that code with:

Code:


$stdout_filename = time() . int(rand(100)) . ".htm";
$stdout_file = "$server_media_path/html/$stdout_filename";

local(*SAVEOUT);
open(SAVEOUT, ">&STDOUT");
open(STDOUT, ">$stdout_file");

&initialize;

close(STDOUT); 
open(STDOUT, ">&SAVEOUT");

print "Location: $url_media_path/html/$stdout_filename\n";

That will redirect users to static HTML representations of the dynamic pages and also change their address bar.  You may want to set up a cron job that deletes these pages nightly ie:

rm -Rf /home/acct/www/ccp51/media/*.htm

Or write something into the CCP cron utility (./cgi-bin/library/common/cron.pl) that will act like the temporary directory purge already in there.

This is very important to do as you will run out of disk space if these items are not deleted regularly.


Nick Hendler

Offline

 

#4 01-11-2005 13:43:49

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 929
Website

Re: How Do We Hide Url Cgi Name & Parameters?


COOL!

That will redirect users to static HTML representations of the dynamic pages

It appears that I can use this routine to create static pages for search engines, yes?


W e b s i t e  E n g i n e e r i n g,   D e s i g n   &   M a n a g e m e n t
Knowledgeable, Experienced, Effective, Available ~ Reasonable prices
wwwBoulderWebsiteEngineering.com

Fast Servers & Reliable Hosting! Reasonable prices.
wwwEZP.net

And, Free Tibet!

Offline

 

#5 01-13-2005 12:46:42

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19124
Website

Re: How Do We Hide Url Cgi Name & Parameters?

Something like it.  I programmed one already that's in use here:




The module outputs static versions of user defined HTML pages and maintains all links to the cgi for dynamic pages.  The downside is that you can't have dynamic content (like a mini-cart) in the site layout.

It works for 5.1 - would need mods for 5.0 - but that's where I sourced the code from.


Nick Hendler

Offline

 

#6 01-14-2005 17:35:55

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 929
Website

Re: How Do We Hide Url Cgi Name & Parameters?


Okay, I got around to testing this. I am using CCP v. 5.0. Is your suggestion specific to 5.1 or can it work with 5.0?

I get an Internal Server Error.

Any thoughts on this?

B Litzen


W e b s i t e  E n g i n e e r i n g,   D e s i g n   &   M a n a g e m e n t
Knowledgeable, Experienced, Effective, Available ~ Reasonable prices
wwwBoulderWebsiteEngineering.com

Fast Servers & Reliable Hosting! Reasonable prices.
wwwEZP.net

And, Free Tibet!

Offline

 

#7 01-23-2005 10:40:08

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: How Do We Hide Url Cgi Name & Parameters?

hi,

i have ccp 5.1 and i get a error 500 when i try the mod above.


can anyone help please?

thanks
charlie wink 

Offline

 

#8 03-23-2005 09:09:47

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19124
Website

Re: How Do We Hide Url Cgi Name & Parameters?

It's not specific to either version.  Can you check your server logs for info on what the error might be?  I haven't implemented this on a large number of sites yet - but I don't think it's OS/Server specific.


Nick Hendler

Offline

 

Board footer