Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Joomla站点的.htaccess文件中重写Url_.htaccess_Mod Rewrite - Fatal编程技术网

在Joomla站点的.htaccess文件中重写Url

在Joomla站点的.htaccess文件中重写Url,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我想在.htaccess文件中编写一条规则,我只想这样做: 用户将查找以下链接: www.example.com/sitemap.xml(在浏览器地址栏中) 但实际上,我想显示以下链接: www.example.com/index.php?option=com\u xmap&view=xml您需要使用mod\u rewrite。书中有很多细节。如果不希望用户在地址栏中看到新URL,则应使用内部重定向 RewriteEngine on RewriteRule "^/sitemap\.xml

我想在
.htaccess文件
中编写一条规则,我只想这样做:
用户将查找以下链接:
www.example.com/sitemap.xml
(在浏览器地址栏中)

但实际上,我想显示以下链接:

www.example.com/index.php?option=com\u xmap&view=xml

您需要使用
mod\u rewrite
。书中有很多细节。如果不希望用户在地址栏中看到新URL,则应使用内部重定向

RewriteEngine  on
RewriteRule    "^/sitemap\.xml$"  "/index.php?option=com_xmap&view=xml" [PT]
试试这个

 RewriteEngine  on
 RewriteCond %{REQUEST_URI} ^/sitemap\.xml$ 
RewriteRule .* /index.php?option=com_xmap&view=xml [QSA,R,L]

下面的答案没有正斜杠,并且带有
[L]
标志