我在写晋远信息网(www.geofuture.net)时没有考虑到URL如何面向搜索引擎优化,完成了以后才开始优化的。这时要考虑一方面要静态的URL,一方面要尽量保持原有的程序不变以便于以后维护,所以就采用url_rewrite的方法。下面是httpd.conf中相应的部分
<VirtualHost *:80>
DocumentRoot /home/geofuture
ServerName www.geofuture.net
ServerAlias *.geofuture.net geofuture.net *.cic123.com
DirectoryIndex index.files index.html index.php
RewriteEngine On
#RewriteLog logs/rewrite.log
#RewriteLogLevel 9
#RewriteRule / http://geofuture.vicp.net/ [L]
RewriteCond %{REQUEST_FILENAME} index.files [OR]
RewriteCond %{REQUEST_FILENAME} error.files [OR]
RewriteCond %{REQUEST_FILENAME} cat.files [OR]
RewriteCond %{REQUEST_FILENAME} area.files [OR]
RewriteCond %{REQUEST_FILENAME} info.files [OR]
RewriteCond %{REQUEST_FILENAME} topic.files [OR]
RewriteCond %{REQUEST_FILENAME} post.files [OR]
RewriteCond %{REQUEST_FILENAME} profile.files [OR]
RewriteCond %{REQUEST_FILENAME} userinfo.files
| 对此文章发表了评论 |
