添加第二次重定向后,htaccess移动重定向不再工作

时间:2013-06-01 14:13:34

标签: .htaccess

我的问题是我有一个重定向到移动子目录,它工作正常。 但是在从非www向www添加第二次重定向后,它似乎不再有用了..

Options +FollowSymlinks
RewriteEngine on

# rules to redirect if mobile browser
# prevent looping
RewriteCond %{HTTP_HOST} !^mydomain.nl/mobile$

# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]

# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC]

# rewrite rules here
RewriteRule ^(.+)\$ http://www.mydomain.nl/mobile/$1 [R=302,NC]

# redirect to preffered www domain
RewriteCond %{HTTP_HOST} ^mydomain\.nl [NC]
RewriteRule ^(.*)$ http://www.mydomain.nl/$1 [L,R=301]

我认为这是一个小问题,但我看不出它有什么问题。 问候, 汤姆

0 个答案:

没有答案