Rewrite /keyword1+keyword2.html to search page | .htaccess

Don’t touch the .htaccess file, there’s this neat tool add_rewrite_rule() which you should hook into init: add_action(‘init’, function() { add_rewrite_rule( ‘search+([^/]+).html$’, ‘index.php?my_custom_search=1&s=$matches[1]&submit=Search’, ‘top’ ); }); Right after that you should flush the rewrite rules once ( by saving the permalink settings in Settings > Permalinks or with flush_rewrite_rules() BUT call that function only once and … Read more

I want to write something that restarts the httpd service when my apache server dies

You need something like this: #!/bin/bash #test-httpd.sh client=”yourname” mailboxes=”[email protected]” # write to that file monitorfile=”/var/www/html/monitor.php” #empty monitor.php > $monitorfile APACHE=`/bin/pidof httpd` echo $APACHE if [ “$APACHE” == “” ] then echo APACHE_FAILURE | mail -s “$client””: CRITICAL : APACHE FAILURE !!!!” $mailboxes #trying to restart it /etc/init.d/httpd stop /etc/init.d/httpd start echo -e “apache:FAIL\n” >> $monitorfile … Read more

I got ERR_TOO_MANY_REDIRECTS on subdomain

I solved this error. The problem is I’ve used a mix of upper and lower case characters in my WordPress General setting URLs. To fix this condition, I must use lowercase URLs in my WordPress General setting URLs.

Strange special character/Latin characters

Still no idea that why and how this happened all of sudden. But here is the 2 Solutions I found which is working: Applying anyone will work 1. Comment these two – //define(‘DB_CHARSET’, ‘utf8’) and //define(‘DB_COLLATE’, ”) 2. Use Latin1, (‘DB_CHARSET’, ‘latin1’) However, I am suspecting some attacks on our sever where blogs are hosted … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)