joomla 1.7.1迁移后url重写问题(现在是2.5.14)



好的,我会尽量简短

我最近为一位客户接管了一个网站的管理工作。它托管在amazon ec2实例上。我需要将它从以前的管理员ec2实例迁移到我自己的实例中。

我使用了akeeba备份和kickstart来完成这项工作,迁移似乎运行得很好,但sef URL被破坏了,这使得网站几乎无法使用,因为很多链接似乎都被硬编码了。

它是运行在amazonec2 ami linux上的joomla 1.7.1 php 5.2.3 apache 2.2。

在joomlaglobalconf中,sef-urls是打开的,但当我打开url重写时,一切都会中断。joomla生成的链接可以在url中使用index.php,但任何硬编码的链接都会出现404个错误。

.htaccess文件名只是.htaccess不是.htaccess.txt。RewriteEngine为ON。

在我的httpd.conf中,我能找到的mod_rewrite的唯一实例是"LoadModule rewrite_module modules/mod_rewrite.so",它没有被注释。allowoverride(无论何时出现)="allowoverride All"和AccessFileName="AccessFileName htaccess"。

我不知道该怎么做才能解决这个问题,客户不会很高兴他的页面上有一半的链接突然被断了

有什么想法吗?我仍然有akeeba备份文件,所以我可以重新开始,但我不知道如何设置apache以防止完全相同的事情再次发生

.htaccess

##
# @version              $Id: htaccess.txt 21101 2011-04-07 15:47:33Z dextercowl$
# @package              Joomla
# @copyright    Copyright (C) 2005 - 2011 Open Source Matters. All rights reser$
# @license              GNU General Public License version 2 or later; see LICE$
##
php_value memory_limit 128M

##
# 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 $
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it$
# beginning of line), reload your site in your browser and test your sef url's.$
# 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
## 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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects
##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##
RewriteBase /
php_value upload_max_filesize 32M
php_value post_max_size 32M
php_value memory_limit 256M
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$$
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

edit:我也以同样的方式迁移了许多其他joomla网站,它们运行良好,唯一的区别是它们被迁移到了rackspace云网站等解决方案中。这个客户端坚持使用amazon ec2,这意味着我必须设置服务器,我确信问题是

edit2:我刚刚更新到2.5.14,有同样的问题

好吧,这不是Joomla 2.5 .htaccess文件,它会给你404。我在当前的2.5版本上创建了一个变体,并添加到您的其他php设置中。它在我的开发机器上工作(你的没有)。

##
# @package      Joomla
# @copyright    Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
# @license      GNU General Public License version 2 or later; see LICENSE.txt
##
##
# 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 dissallows 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
## 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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects
##
# 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.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
php_value upload_max_filesize 32M
php_value post_max_size 32M
php_value memory_limit 256M

这似乎是一个.htaccess问题,但如果是这样的话,你会得到500个错误,而不是404个。

在一个安装程序上运行的.htaccess指令可能会在另一个设置程序上产生冲突,您可以尝试手动修复它(在您的apacheerror_log中可能有错误的痕迹),或者使用fasterjoomla的小助手尝试一下,它有几个例程可供尝试http://www.fasterjoomla.com/repository/littlehelper

最新更新