开发者

Problem 301 redirect not allowing login in the backend

I am finding some problems in the htaccess of CMS with a 开发者_如何学编程301 redirect.

When trying to solve canonical urls (redirecting site to www.site) I got the problem that I cannot log in in the back end (www.site/admin).

The htaccess condition is:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.site\.co.uk$
RewriteRule (.*) http://www.site.co.uk$1 [R=301,L]

I guess I need to include a expression that allows the URI /admin not to be redirected, but how?


Like this, for example:

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTP_HOST} !=www.example.co.uk
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule .* http://www.example.co.uk%{REQUEST_URI} [R=301,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜