我有两个网址
/web/20110606105658/
/about-us/AwardDetails.aspx?AWDID=1
我必须在htaccess中为URL设置不同的404错误页面
离。
/web/20110606105658/
应该转到www.google.com
/about-us/AwardDetails.aspx?AWDID=1
应该转到www.yahoo.com
答案 0 :(得分:0)
您需要对此404处理使用mod_rewrite
规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^web/20110606105658/?$ http://www.google.com/ [L,NC,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} ^AWDID=1$ [NC]
RewriteRule ^about-us/AwardDetails\.aspx$ http://www.yahoo.com/ [L,NC,R=301]