使用htaccess做301跳转或302跳转

编辑.htaccess文件,不带www,301跳转到带www的域名:

  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^1.com$
  3. RewriteRule ^(.*)$ http://www.1.com [R=301,L]

旧域名1.com做301跳转到新域名2.com :

  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^www.1.com$ [OR]
  3. RewriteCond %{HTTP_HOST} ^1.com$
  4. RewriteRule ^(.*)$ http://www.2.com [R=301,L]

centos安装apache(httpd)+mysql+php+mysql-php+php-gd

centos安装apache,mysql,php
顺手记录下,方便使用。

  1. [root@localhost ~]# yum check-update
  2. [root@localhost ~]# yum install httpd mysql-server php php-mysql php-gd -y && service  httpd restaart
1 1