【问题标题】:HTTP 303: http:// instead of http://www results in Loop / 303HTTP 303:http:// 而不是 http://www 导致 Loop / 303
【发布时间】:2012-04-25 01:02:23
【问题描述】:

我有一个 Joomla! 1.5.23 网站运行 Artio 用于 SEF 网址。 完成配置:

  • JoomSEF3 3.9.5
  • Virtuemart JoomSEF 扩展 2.1.1
  • Joomla! 1.5.23
  • Virtuemart 1.1.9
  • Joomfish 2.0.4

我已经告诉 Artio(SEF 组件)只使用 www url。不知何故,当我转到没有 www 的 http:// url 时,浏览器会挂起。 Firefox 11 告诉我

The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

告诉 Artio 不要处理 www 非 www 的东西并清除 url 仍然让我在非 www url 上遇到同样的问题。 Firebug 在两种情况下(两种 Artio 设置)都向我显示状态 303 - 请参阅其他。让我觉得这是一个 .htaccess 问题或 DNS 问题。这是.htaccess:

##
# @version $Id: htaccess.txt 9975 2008-01-30 17:02:11Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that disallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
# Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

# non-www to www

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


#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## 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


########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits


######## Redirect to keep old site running
#
DirectoryIndex index.php index.html
#
######## End Redirect preservation

######## Fix memory issue 
php_value memory_limit 40M
php_value max_execution_time 200
php_value max_input_time 200
php_value upload_max_filesize 20M

我以前从未有过 303。我怎样才能让 www-less url 再次起作用?

更新 1

当我取消注释时

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

我收到了 301,无法使用 www url 访问该网站

更新 2 本周与 SEF 组件的制造商 Artio 一起进行一些测试。这里似乎没有人知道,所以这似乎是最好的方法。

【问题讨论】:

    标签: redirect joomla joomla-sef-urls


    【解决方案1】:

    Artio 的好人为我找到了问题:“...问题是由 System – Jfrouter 插件中启用的“使用 302 重定向”选项引起的。非 www 域似乎被正确重定向如果禁用此选项,则转到 www。” 现在一切正常。

    【讨论】:

      猜你喜欢
      • 2012-11-18
      • 1970-01-01
      • 1970-01-01
      • 2012-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-02
      • 2010-09-29
      相关资源
      最近更新 更多