Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
532 views
in Q2A Core by

As suggested here: http://www.question2answer.org/secure.php

Can any one pls tell me how to do this?

I tried to upload the original config file into an extrnal server and used 

 

REQUIRE 'http://www.mysite.com/path/to/file.php' ;

 

But it doent seem to work.

Any help would be appreciated.

Thanks!

Q2A version: 1.6 (latest)

1 Answer

0 votes
by
selected by
 
Best answer

You cannot include the file using 'http://example...' because the file cannot be accessed via HTTP. That is the point of moving it outside of the web root.

You need to reference it using the filesystem name. It depends on your set up, most hosts will point the site to a folder like /var/www/example/public. Then http://www.example.com/file.php will be at /var/www/example/public/file.php in the filesystem.

However, the page there about security is saying you should move the file to /var/www/example/file.php so it cannot be accessed via the web.

 

* If your are not sure what your document root is, you can get it via PHP using: echo $_SERVER['DOCUMENT_ROOT'];

 

by
Thanks so much Scott...I think this is what I have been looking for!
...