Jump to content

Recommended Posts

Posted (edited)

Would anyone know how I could do this?

 

I have a file located at: "[hidden]/plans/admin/plans.cgi" that I want protected.

 

I have a PHP program that "hides" the real address to the file by using frames. However, if the user views the source, they can get to the acuall page.

 

What I'm wanting to know is; Is there a way to allow the page throught the framset while blocking a direct link (i.e. typing the address into the address bar)?

- OR -

Is there someway I could "encrypt" the source that will still allow a browser to work?

 

 

(I realy hope this hade sense)

 

Many Thanks,

Dman8568

Edited by Dman8568
  • 2 weeks later...
Posted (edited)

Hi,

 

If i am correct, if you do a "include once" done in PHP, the user does not know where the file is pulled from or even what it is called. I don't know if this is any help?

 

Altertively, use my old friend the htaccess, this is taken from another page about a weblog, but I believe the principle should be the same.

 

If you don't have access to your web server's configuration file or your sysadmin/provider can't/won't make changes for you, you just might have mod_rewrite, a very powerful Apache web server module for altering URLs and much more, available to you.

 

Put the blosxom.cgi script in your cgi-bin directory -- the directory where you're allowed to keep scripts and have them run.

 

Create a regular text file called .htaccess in your document directory -- where all of your Web-accessible HTML files are kept. The .htaccess file should look something like:

 

RewriteEngine on

RewriteRule ^weblog/?(.*)$ /cgi-bin/blosxom.cgi/$1

 

Where weblog is wherever you'd like your weblog to live (in this case /weblog) and cgi-bin is where you're supposed to call scripts from your Web browser to have them run.

 

All of your entries, flavour files, stylesheets, and so forth should live, as they always have, in your Blosxom $datadir.

 

Another version of this allows you to serve up your weblog at /, rather than requiring a "subdirectory" like /weblog. It's rather clever, really, farming out to Blosxom any request for a file or directory that doesn't exist. Blosxom as 404 ;-) Simply Blosxom into your document directory along with a .htaccess reading:

 

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ blosxom.cgi/$1 [L,QSA]

 

Point your browser at /something and, if there exists no /something directory, Blosxom should kick right in.

 

Now, any URL starting with /weblog is intercepted by the rewrite engine and passed to the blosxom.cgi script, along with anything after /weblog (and an optional /) is passed to my CGI script as path_info, as it should be.

 

Any URL not starting with /weblog is served up just like it should be, so stylesheets, other arbitrary HTML files, graphics, and so forth are reachable at /whatever/their/url.

 

Should sort out your problem!

 

Jimuni

Edited by Jimuni

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...