sudo apt-get purge --auto-remove syslog-ng
Monthly Archives: January 2016
PHP Redirect – Header Location
PHP Redirect – Header Location
<?
header( “location: http://surin.reru.ac.th” );
exit(0);
?>
exit(0);
?>
PHP Redirect – Header Refresh
<?
header( ”refresh: 2; url=/url” );
exit(0);
?>
header( ”refresh: 2; url=/url” );
exit(0);
?>
sudo /etc/init.d/apache2 start
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:8080 no listening sockets available, shutting down Unable to open logs …fail!
#sudo netstat -tulpn| grep :80
#killall -9 apache2
#sudo /etc/init.d/apache2 start
* Starting web server apache2 …done. ok wokr
Redirecting from HTTP to HTTPS with PHP
<?php
if (! isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off' ) {
$redirect_url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location: $redirect_url");
exit();
}
?>