.htaccess 使用htaccess将页面从一个页面重定向到另一个页面,而不更改url

.htaccess 使用htaccess将页面从一个页面重定向到另一个页面,而不更改url,.htaccess,joomla2.5,.htaccess,Joomla2.5,在joomla中是否有任何方法可以在不更改url的情况下将页面从一个页面重定向到另一个页面 我想更改url 到 如何改变它 这是我的htaccess文件 ## # @version $Id: htaccess.txt 21101 2011-04-07 15:47:33Z dextercowley $ # @package Joomla # @copyright Copyright (C) 2005 - 2011 Open Source Matters. All ri

在joomla中是否有任何方法可以在不更改url的情况下将页面从一个页面重定向到另一个页面

我想更改url

如何改变它

这是我的htaccess文件

##
# @version      $Id: htaccess.txt 21101 2011-04-07 15:47:33Z dextercowley $
# @package      Joomla
# @copyright    Copyright (C) 2005 - 2011 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

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI}  ^/index\.php/component/quates   [NC]
RewriteRule .*   index.php/component/quotes   [R=301,L]

## 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.
##
#@version$Id:htaccess.txt 21101 2011-04-07 15:47:33Z dextercowley$
#@Joomla
#@copyright版权所有(C)2005-2011开源事宜。版权所有。
#@license GNU通用公共许可证版本2或更高版本;请参阅LICENSE.txt
##
##
#如果您选择使用此文件,请完整阅读此文件!
#
#此部分下方的行:“选项+FollowSymLinks”可能会导致问题
#使用一些服务器配置。使用mod_rewrite时需要它,但可能已经存在
#由服务器管理员以允许在中更改的方式进行设置
#您的.htaccess文件。如果使用它导致服务器出错,请将其注释掉(添加到
#行的开头),在浏览器中重新加载站点并测试sef url。如果有效的话,
#它已由服务器管理员设置,您不需要在此处设置。
##
##如果导致错误,可以注释掉,请参见上面的注释。
选项+FollowSymLinks
##Mod_正在使用中重写。
重新启动发动机
选项+FollowSymLinks
重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
RewriteCond%{REQUEST_URI}^/index\.php/component/quates[NC]
重写规则。*index.php/component/quotes[R=301,L]
##开始-重写规则以阻止一些常见的漏洞攻击。
#如果您的网站出现问题,请排除下面列出的操作
#这将试图阻止对Joomla的最常见类型的利用“尝试”!
#
#阻止任何试图在URL中对数据进行base64_编码的脚本。
RewriteCond%{QUERY\u STRING}base64\u encode[^(]*\([^)]*\)[或]
#阻止在URL中包含标记的任何脚本。
重写cond%{QUERY_STRING}(|%3E)[NC,或]
#阻止任何试图通过URL设置PHP全局变量的脚本。
重写条件%{QUERY\u STRING}全局(|\[|\%[0-9A-Z]{0,2})[或]
#阻止任何试图通过URL修改_请求变量的脚本。
重写条件%{QUERY\u STRING}\u请求(|\[|\%[0-9A-Z]{0,2})
#返回403禁止标题并显示根主页的内容
重写规则。*index.php[F]
#
##结束-重写规则以阻止一些常见的漏洞攻击。
##开始-自定义重定向
#
#如果需要重定向某些页面,或将规范非www设置为
#www重定向(反之亦然),将代码放在这里
#重定向使用正确的重写规则语法和[R=301,L]标志。
#
##结束-自定义重定向
##
#如果您的Web服务器的URL
#与物理文件路径没有直接关系。
#更新您的Joomla!目录(仅适用于根目录)。
##
#重写基/
##开始-Joomla!核心SEF部分。
#
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
#
#如果请求的路径和文件不是/index.php,则
#尚未在内部重写为index.php脚本
重写cond%{REQUEST_URI}!^/index\.php
#请求的是组件文件夹中的内容,
#或用于站点根目录,或用于无扩展URL,或
#请求的URL以列出的扩展名之一结尾
重写cond%{REQUEST_URI}/component/|(/[^.]*|\(php | html |提要| pdf | vcf |原始))$[NC]
#请求的路径和文件与物理文件不直接匹配
重写cond%{REQUEST_FILENAME}!-f
#请求的路径和文件与物理文件夹不直接匹配
重写cond%{REQUEST_FILENAME}!-d
#在内部将请求重写为index.php脚本
重写规则。*index.php[L]
#
##结束-Joomla!核心SEF部分。
您可以尝试以下方法:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI}  ^/index\.php/component/quates   [NC]
RewriteRule .*   index.php/component/quotes   [R=301,L]
永久重定向

http://idaycom.com/index.php/component/quates

http://idaycom.com/index.php/component/quotes


对于静默映射,请将[R=301,L]替换为[L]

您可以尝试以下方法:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]

我在我的网站上使用了此功能。

您可以通过多种方式进行尝试:

RedirectMatch "^/existingfile\.html/?$" "http://example.com/newfile.php"

这会将您现有的url重定向到新的url

举个例子。无法理解如何可以重定向到具有相同url的另一个页面,除非您在另一个域中谈论相同的url路径。@faa我在jooomla 2.5网站工作。我想将url更改为“OK”。它确实是一个不同的url。哪些字符串是固定的哪些是动态的?@faa idaycom.com/index.php/component/是固定的。如果只想将quates更改为quotesHey@Preethy,请返回并“勾选”一个您觉得有用的答案/您自己的答案?:)请将我答案中的整个规则集复制粘贴到根目录中的.htaccess文件。它会按照说明重定向。请确保浏览器的cache已被清除。如果失败,可能还有其他规则?请在我的htacces文件中查看全部规则。您可以给我您的电子邮件地址吗?这样便于交流首先尝试复制粘贴到您的问题中更改所有敏感内容,这样每个人都可以看到它并最终回答问题。@Preethy我不熟悉Joomla,看不出它不重定向到
/quotes
,但该规则集不应该放在.htaccess文件中的注释
##Begin-Custom redirects
之后吗?