Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.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
Php web路由和公用目录之间的htaccess冲突_Php_Apache_.htaccess_Magento_Mod Rewrite - Fatal编程技术网

Php web路由和公用目录之间的htaccess冲突

Php web路由和公用目录之间的htaccess冲突,php,apache,.htaccess,magento,mod-rewrite,Php,Apache,.htaccess,Magento,Mod Rewrite,我有一个带有第三方模块的Magento项目,该模块在/sitemap路径上创建HTML站点地图。同时,我们有一个站点地图目录,其中包含一系列可公开访问的XML站点地图(发布到Google等)。站点地图目录就位后,/sitemap路由会导致重定向循环 我正在寻找一个htaccess重写规则,它允许我通过Magento中的标准index.php路由机制提供/sitemap URL,但允许sitemap/*.xml作为文件提供 这是我的尝试,我希望可以检查URI是否包含/sitemap而不是文件,然后

我有一个带有第三方模块的Magento项目,该模块在/sitemap路径上创建HTML站点地图。同时,我们有一个站点地图目录,其中包含一系列可公开访问的XML站点地图(发布到Google等)。站点地图目录就位后,/sitemap路由会导致重定向循环

我正在寻找一个htaccess重写规则,它允许我通过Magento中的标准index.php路由机制提供/sitemap URL,但允许sitemap/*.xml作为文件提供

这是我的尝试,我希望可以检查URI是否包含/sitemap而不是文件,然后将当前请求重写为HTML sitemap模块的完整URL,但似乎没有任何效果

RewriteCond %{REQUEST_URI} ^sitemap
RewriteCond %{REQUEST_URI} !-f
RewriteRule %{REQUEST_URI} sitemap/index/index #The full URL of the HTML sitemap page.
更改:

RewriteCond %{REQUEST_URI} !-f

更改:

RewriteCond %{REQUEST_URI} !-f

重写规则^([a-z\+)\.php$/%1/$1.xml[L]重写规则^([a-z\+)\.php$/%1/$1.xml[L]