Sir,
I installed osFAQ v1.2-ST
All is OK, but I face a little problem.
When I try to Create a Category or FAQ or when I try to change the settings, I was redirected to my cpanel's url.
Example:
I install osFAQ in www.mydomain.in/support
When I try to change the "Default Timezone?" the script was redirected to the link given bellow.
http://eu7.host.org/support/scp/osfaq_admin.php?settings=true&action=edit_setting&fsID=2
it should be
http://www.mydomain.in/support/scp/osfaq_admin.php?settings=true&action=edit_setting&fsID=2
So please help me how do I define my domain?
How to change it?
http://eu7.host.org/
to
http://www.mydomain.in/
Thanking You
Anonymous
Hi,
Please edit the file /faq/include/config.faq.php
Change line 26 from:
define('SERVER_DOMAIN', $_SERVER['SERVER_NAME']);
to
define('SERVER_DOMAIN', 'www.mydomain.in');
If you need more control, you can specify specific domains for http and https if you are using SSL. They are on lines 31 and 32.
Kind Regards,
Tim Gall
So I remove the code
$_SERVER['SERVER_NAME']
Thanks for your help.
another question?
Is it ok if I change
define('SERVER_DOMAIN', $_SERVER['SERVER_NAME']);
to
define('SERVER_DOMAIN', getenv('HTTP_HOST');
Sorry, I missed your reply earlier.
Yes replace $_SERVER['SERVER_NAME']
with 'www.mydomain.in'
Dont forget the single quotes.
Yes getenv('HTTP_HOST') would also be ok but you might end up with the same problem you were having previously. Give it a try, It wont hurt anything.
By the way you are missing a closing bracket in the example you posted.
define('SERVER_DOMAIN', getenv('HTTP_HOST');
should be:
define('SERVER_DOMAIN', getenv('HTTP_HOST'));
You could also use:
$_SERVER['HTTP_HOST']
Most of the $_SERVER variables are set based on your webservers installation, so your HTTP_HOST entry may be more reliable than the SERVER_NAME entry. Both are in the $_SERVER global array set by the webserver; both should usually be the same.
getenv() will check all of the global server arrays for a matching entry.
Hope that helps.
Regards,
Tim
Last edit: Tim Gall 2013-04-09