0

我需要能够做到,以便当有人访问我的网站时说:

一)http://www.mysite.co.uk/

它实际上显示以下内容:

b) http://www.mysite.co.uk/catalog/index.php

并且如果用户输入(b),那么他们是 301'd 到(a)

在我的 .htaccess 中,我目前有以下内容,但这会导致 301 循环错误

RewriteRule ^/?$ catalog/index.php [L]
Redirect 301 /catalog/index.php http://www.mysite.co.uk

有没有办法解决这个问题?谢谢

4

1 回答 1

0

尝试以下几行:

#Permanently redirect BROWSER requests for the .php script to the Site root:
RewriteCond %{THE_REQUEST}      /catalog/index.php     [NC]
RewriteRule ^.*                 http://%{HTTP_HOST}/   [R=301,L]

#Internal redirect (Alias) the root of the site to: /catalog/index.php
RewriteRule ^$                  /catalog/index.php      [L]
于 2012-11-14T03:54:58.107 回答