【问题标题】:How to use the rewrite rule to enable a redirection?如何使用重写规则来启用重定向?
【发布时间】:2011-07-13 22:28:21
【问题描述】:

我有这套重写规则:

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
RewriteCond %{HTTP_HOST} ^drheliodias.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.drheliodias.com$
RewriteRule ^arquivos$ "http\:\/\/www\.4shared\.com\/dir\/PsKX6Kkn\/_online\.html" [R=301,L]

正如 cmets 建议的那样,我正在使用 Joomla,我通过 http://www.drheliodias.com 访问我的主页,效果很好。虽然,我希望 http://www.drheliodias/arquivos 重定向到我的 4shared 虚拟文件夹,就像我使用 cPanel 所做的那样。我检查了我的 .htaccess 文件,确实有这个重定向(如最后一行所示),但只要我输入http://www.drheliodias/arquivos,我的 joomla 就会说这个页面不存在。我该如何解决?

【问题讨论】:

    标签: .htaccess joomla url-rewriting


    【解决方案1】:

    只需将此行放在 Joomla 部分之前,紧随其后 “RewriteEngine On”指令:

    RedirectMatch 303 ^arquivos$ http://www.4shared.com/dir/PsKX6Kkn/_online.html
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-27
      • 1970-01-01
      • 1970-01-01
      • 2012-05-30
      • 2023-03-18
      相关资源
      最近更新 更多