How to Redirect a Page with HTTP 301 in PHP

Posted on

HTTP 301 Redirect is an SEO friendly way to redirect readers to a page’s new location. There are a lot of benefits of using HTTP 301 Redirect. These benefits can be found in the htaccess method post. htaccess or PHP can be both used for sending 301 redirects. The htaccess method can be found in
Read more

Friendly WordPress Navigation Using Page Numbers Instead of Next and Previous Links

Posted on

The navigation will be more user friendly with page numbers instead of next and previous links since users can navigate much quicker to the page they want to see especially when there are a lot of pages. It is also good method for SEO (Search Engine Optimization) because it creates a tighter inner link structure.
Read more

Using noindex Meta Tag in WordPress to Prevent Search Engines Indexing Categories, Tags and Archives

Posted on

WordPress may show “duplicate” content which may potentially confuse search engines. Duplicate content won’t hurt much, unless it is spam or keyword stuffing, as said by Matt Cutts, and Google may just ignore the duplicate content. However, instead of letting the search engines decide which pages of the duplicate ones are important, we may only
Read more

How to Redirect Old Domain to New Domain Using htaccess Redirect

Posted on

I want to move the sub domain blog.pkill.info to systutorials.com permanently. I can manage all the pages I want to post using WordPress. Changing domain in a bad way is dangerous. Put a page the tell the reader that the site is moved to a new domain is very unfriendly to the user and also
Read more

Use Excerpt in Index, Category, Tag and Arhieve Pages for WordPress

Posted on

By default, all of the content of the post is shown in index, category, tag, archive and search pages. This is duplicate contents which may cause search engine penalty. The better way is using excerpt in index, category, tag and arhieve pages. By doing this the duplication can be avoided and the blog is optimized.
Read more

How to Change the Site’s Default 404 Error Not Found Page

Posted on

The apache’s default “404 Error not found” page seems ugly. And may some hosting service put theire ads in it. We can add some entry in .htaccess to change the defualt 404 error page. This method can also be used for some other error codes. A list of the server returned codes can be found
Read more

Using “META” Tag in HMTL HEAD to Redirect Pages

Posted on

It is quite simple to redirect pages using the “meta” tag in HTML head, I just give the example to redirect the page to https://www.systutorials.com after 1 second. <html> <head> <meta http-equiv=”Refresh” content=”1; url=https://www.systutorials.com/”> </head> <body> This page is redirected to: <a href=”https://www.systutorials.com/”>systutorials.com</a>.<br /> </body> </html>

Yum Using DVD as Package Repository

Posted on

We introduce the method to use DVD as the package repository for yum. In this post, we use CentOS 5 as the example. 1) Modify /etc/yum.repos.d/CentOS-Base.repo Delete baseurls in [Base] baseurl by add ‘#’ at the beginning of the lines Then add a line at the end: baseurl=file:///media/CentOS_5.0_Final ‘file://’ means this is a local directory.
Read more

Script: Checking Alive Servers from a Server List

Posted on

With a list of servers, it is common that one or more are down or crash. Lots cluster management tools can detect the aliveness of servers. However, it can be easily done with ping with a Bash script. I summarize the script that I used and share it here: check-alive-server.sh. Usage: usage: ./check-alive-server.sh file Each
Read more

Script: Shutting Down All Xen VMs on a Server

Posted on

Shutting down servers is a common operations for managing a cluster. However, if this server is configured to a Xen Dom0 and has Xen VMs (DomUs), the VMs should be shutdown first to avoid data lost on these VMs. xm supports a -a option to shutdown all VMs: # xm shutdown -a Add the -w
Read more

Emacs Tips and Howtos

Posted on

With Emacs, I feel happy. I love the rich functions of Emacs, such as compiling, quickly jumping to the lines with compilation error and debugging with gdb, and more. I ever wrote small tips posts about Emacs before. But it is a good idea to put them together and keep adding new ones. Here comes
Read more

How to Generate and Apply Patches using diff and patch on Linux

Posted on

`diff` and `patch` are tools to create patches and apply patches to source code, which is widely used in the open-source world, such as Linux kernel and application. patch: applying patches To apply a patch to a single file: $ patch < foo.patch If the foo.patch does not identify the file the patch should be
Read more

Configuring Mouse Cursor Style for QT Applications in GNOME / MATE Desktop

Posted on

QT and GTK applications use different settings for cursor styles. This makes the mouse cursor styles for QT applications in the GNOME / MATE desktop environment or GTK applications in the KDE desktop environment look different with other programs. In the post [[configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop]], we talked about how to configure the mouse cursor style for GTK
Read more

Setting MATE as Default Desktop Environment for startx on Fedora

Posted on

I ever discussed Starting KDE from Command Line by startx for KDE and GNOME. Recently, I installed MATE desktop on Fedora 17 and am very happy with it—dear, Gnome 2 is back. However, I checked the /etc/X11/xinit/Xclients script which is called by ‘startx’ and it only includes ‘startkde’ and ‘gnome-session’ without support to MATE. But
Read more

How to Change Systemd Runlevel on Fedora Linux – The Manual Way

Posted on

Fedora Linux starts to use systemd to manage system service. The /etc/inittab is no longer used by systemd. The old method of editing /etc/inittab to change system runlevel does not work anymore. This post introduces a “manual” way to change the boot levels. For the general method, please check https://www.systutorials.com/change-systemd-boot-target-linux/. systemd uses ‘targets’ instead of
Read more