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.
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.
Offline
Try using mod_rewrite rules, there are a few posts on this subject, do a search or install ATS SEO module.
Offline
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:
&initialize;
Replace that code with:
$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.
Offline
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?
Offline
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.
Offline
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
Offline
hi,
i have ccp 5.1 and i get a error 500 when i try the mod above.
can anyone help please?
thanks
charlie
Offline
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.
Offline