.htaccess - Joomla 链接在实时站点上正常,但在本地服务器上不正确

标签 .htaccess joomla localhost joomla1.5 mamp

<分区>

我的 Joomla 站点一直在运行,没有任何问题。我想对其进行一些更改,因此我将整个站点和数据库下载到我的本地主机。当我加载本地站点时,一切都显示正常,但是所有内部链接都已更改。例如现在显示的链接是:

http://localhost:8888/centrevision/http:/localhost/centrevision/dvr-systems/view-all-products.html

它应该在哪里:

http://localhost:8888/centrevision/dvr-systems/view-all-products.html

我确定这只是配置文件或 .htaccess 中的设置的一个例子,但我不知 Prop 体要更改什么。

Joomla 版本是 1.5.26,我使用 MAMP 作为本地服务器。

感谢任何帮助。

... htaccess

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 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 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!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# 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 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 root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|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

最佳答案

在实时服务器上有类似的问题。有帮助的是在 configuration.php 文件中添加实时站点:

    var $live_site = 'http://localhost:8888/centrevision';

希望这对你也有用。

关于.htaccess - Joomla 链接在实时站点上正常,但在本地服务器上不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12050078/

相关文章:

.htaccess - 如何在 .htaccess 中创建虚拟文件夹

php - 在 wampserver 中重定向索引页面

mysql - Joomla:死链接后,很多查询使我的网站性能变差

angularjs - 让templateUrl指向一个html文件

.htaccess 将所有其他浏览器语言重定向到默认语言

php - PHP 头函数的替代品

html - 从 SQL 表中获取图像

joomla - 更新 : :Extension: Could not open https://update. joomla.org/core/sts/extension_sts.xml

wordpress - 本地主机 WordPress 不工作

java - Spring 资源映射不适用于 localhost