1
我所有的网址有以下模式:如何设置htaccess的正确(重定向)
这个网址将通过此来handeled:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /?lang=$1&subid=$2&id=$3 [L,QSA]
所以我要的是以下重定向:
#Start page:
domain.de -> www.domain.de/de/abc/index.html
domain.de/LANG/ -> www.domain.de/LANG/abc/index.html
www.domain.de -> www.domain.de/de/abc/index.html
wwww.domain.de/LANG/ -> www.domain.de/LANG/abc/index.html
#In general:
all pages without www should be redirected to page with www
#subdomain
subdomain.domain.de -> www.domain.de/de/abc/xy.html
我开始:
RewriteEngine On
# domain.de -> www.domain.de/de/abc/index.html
RewriteCond %{HTTP_HOST} ^(domain\.(de))$
RewriteRule .+ http://www.%1/%2/abc/index.html$0 [L,R=301]
# www.domain.de/de -> www.domain.de/de/abc/index.html
RewriteCond %{HTTP_HOST} ^www\.domain\.(de)$
RewriteRule ^%1/?$/abc index.html [L,R=301]
# subdomain.domain.de to http://www.domain.de/de/abc/xy.html
RewriteCond %{HTTP_HOST} ^subdomain\.(domain\.(de))$
RewriteRule .+ http://www.%1/%2/abc/xy.html [L,R=301]
但现在我不知道如何继续下去。你可以帮我吗?
嘿感谢你的帮助 - 见我的答案。 – user1137370 2013-03-25 14:25:15
你可以请你检查你的error.log 500以上的错误,并告诉我你到达那里? – anubhava 2013-03-25 15:24:34
我想我知道这个问题,现在看看我的编辑。 (尽管你现在可能会得到404)。 – anubhava 2013-03-25 15:27:04