apache rewrite 域名跳转

 

  
  
  
  
  1. <VirtualHost *:80> 
  2.     DocumentRoot /home/www/ROOT  
  3.     ServerName www.xxx.com  
  4.     JKMountFile conf/urimap_dongcom.properties  
  5.     JkLogFile logs/mod_jk_dongcom.log  
  6.     JkLogLevel error  
  7.     Options Indexes FollowSymLinks  
  8.     RewriteEngine On  
  9.     RewriteRule ^/bbs/content-([0-9]+)\.html$ /bbs/content.jsp?id=$1 [P,L]  
  10.     RewriteRule ^/community/bbs\.html$ /community/getallcomlist.action [P,L]  
  11.     RewriteRule ^/community/list-([0-9]+)\.html$ /community/community.action?id=$1 [P,L]  
  12.     RewriteRule ^/community/content-([0-9]+)-([0-9]+)\.html$ /community/getreplybytheme.action?comId=$1&themeId=$2 [P,L]  
  13.  
  14. </VirtualHost> 
  15.  
  16. <VirtualHost *:80> 
  17.     DocumentRoot /home/www/ROOT  
  18.     ServerName www.xxx.com.cn  
  19.     JKMountFile conf/urimap_dongcom.properties  
  20.     JkLogFile logs/mod_jk_dongcom.log  
  21.     JkLogLevel error  
  22.     Options Indexes FollowSymLinks  
  23.     RewriteEngine On  
  24.     RewriteRule ^/bbs/content-([0-9]+)\.html$ /bbs/content.jsp?id=$1 [P,L]  
  25.     RewriteRule ^/community/bbs\.html$ /community/getallcomlist.action [P,L]  
  26.     RewriteRule ^/community/list-([0-9]+)\.html$ /community/community.action?id=$1 [P,L]  
  27.     RewriteRule ^/community/content-([0-9]+)-([0-9]+)\.html$ /community/getreplybytheme.action?comId=$1&themeId=$2 [P,L]  
  28.    RewriteRule ^/(.*) http://www.xxx.com/$1 [L]  
  29. #从一个域名跳转到另外域名
  30. </VirtualHost> 
  31.  
  32. <VirtualHost *:80> 
  33.     DocumentRoot /home/www/ROOT  
  34.     ServerName t.xx.com  
  35.     JKMountFile conf/urimap_dongcom.properties  
  36.     JkLogFile logs/mod_jk_tdongcom.log  
  37.     JkLogLevel error  
  38.     Options Indexes FollowSymLinks  
  39. </VirtualHost> 
  40. <VirtualHost *:80> 

 

本文出自 “林清杨--技术博客” 博客,谢绝转载!

你可能感兴趣的:(职场,域名,休闲)