在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]
标志