开发者

HTACCESS doesn't work

We are using wordpress multisite for a website. We have some url that we need to redirect to new one. We have tried few htaccess redirection but nothing work.

The last line is the redirection that we cannot make works.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

#redirect mobile browsers
RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://www.ourdomain.co.uk/blog [R=301,L]
RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
RewriteRule ^(.*)$ http://www.ourdomain.co.uk/blog [R=301,L]
RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
RewriteRule ^(.*)$ http://www.ourdomain.co.uk/blog [R=301,L]

RewriteCond %{HTTP_HOST} ^ourdomain.co.uk$
RewriteRule ^(.*) http://www.ourdomain.co.uk/$1 [QSA,L,R=301]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)开发者_开发知识库 $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

RewriteCond %{QUERY_STRING} page=135
RewriteRule ^index\.php$ http://www.ourdomain.co.uk/about-us/$1? [R=301,L]

Do you have any ideas?

Thanks


Try putting those last 2 lines before the first rule, so you end up with:

RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} page=135
RewriteRule ^index\.php$ http://www.ourdomain.co.uk/about-us/$1? [R=301,L]

RewriteRule ^index\.php$ - [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜