Archive: web开发
-
十一 20, 2009
No Commentsapache .htaccess no-www to www
参考:http://www.askitexpert.com/question/redirect-nonwww-to-www-in-apache/10 有两种办法 1.在.htaccess的适当位置加入如下代码 yourdomain改成你的域名 RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC] RewriteRule ^(.*) http://www.yourdomain.com/$1 [L,R=301] 2.在 apache的配置文件中 RewriteEngine On RewriteOptions Inherit RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.yourdomain.com/$1...
-
十一 19, 2009
No Commentsapache 多ip 多域名 虚拟主机配置
#由于是多 ip 监听同一个端口所以这样写 Listen 80 #若是多ip 多端口 则是 #Listen 192.170.2.1:80 #Listen 192.170.2.5:8000 #由于使用多ip NameVirtualHost这样设置了下,没查到详细的资料 NameVirtualHost 1.2.3.4:80 NameVirtualHost 5.6.7.8:80 #第一个ip给域名www.hellokeykey.com <VirtualHost 1.2.3.4:80> ServerAdmin key@hellokeykey.com DocumentRoot /var/www/html/hellokeykey.com ServerName www.hellokeykey.com ServerAlias hellokeykey.com </VirtualHost> #第二个ip给域名www.magentokey.com <VirtualHost 5.6.7.8:80> ServerAdmin key@hellokeykey.com DocumentRoot /var/www/html/magentokey.com ServerName www.magentokey.com ServerAlias magentokey.com </VirtualHost> 转载标明出处:hellokeykey.com...
