How to set posts redirect to a new domain

Linux, snippet, Uncategorized, Wordpress, , , , , Leave a comment

I’m moving out a blog to a new domain, and redirect all posts specifically to a new domain.

should go to

Apache Server

On Apache that allows .htaccess, you can add this line on top of the file:

RewriteEngine on
RewriteRule ^(.*)$ http://www.newsite.COM/$1 [R=301,L]

Nginx Server

On Nginx, add this line on server block configuration file:

server {
return 301$request_uri;

Reload or restart Nginx for the change to take effect.


Make Your Server To Update WordPress Seamlessly

How To, Linux, Wordpress, , Leave a comment

If you have issue doing “one click” WordPress upgrade on your server. This might be usefull for you:

First of all, include your username to “www-data” group.

[shell]# usermod -a -G www-data pupungbp[/shell]

then, change group ownership of your www files to www-data

[shell]# chgrp -R www-data /home/pupungbp/sites/[/shell]

add capability to group to have write access

[shell]# chmod -R g+w /home/pupungbp/sites/[/shell]

find and change directory permission to 775 (owner and group writeble)

[shell]# find /home/pupungbp/sites -type d -exec chmod 2775 {} \;[/shell]

give read and write access to user and group on files

[shell]# find /home/pupungbp/sites -type f -exec chmod ug+rw {} \;[/shell]

Last step, open up your wp-config.php and add this following code at the top of the file.


Lets try to upgrade your WordPress update or plugins. Cheers.

How to Enable Mod Rewrite Apache2 on Debian

How To, Linux, , Leave a comment

I assume you have already Apache2 installed on your server. Enabling mod_rewrite is quite easy, run the following command:
# sudo a2enmod rewrite

Then, edit your virtual host configuration file in /etc/apache2/sites-available:
<Directory /home/pupungbp/sites/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None #change None to FileInfo
Order allow,deny
allow from all

Then, restart Apache:
# service apache2 restart