Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/23.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
.htaccess 在htaccess中按文件扩展名重定向_.htaccess - Fatal编程技术网

.htaccess 在htaccess中按文件扩展名重定向

.htaccess 在htaccess中按文件扩展名重定向,.htaccess,.htaccess,我需要将对web特定子文件夹中的aspx文件的所有调用重定向到具有.php扩展名的相同名称和路径 比如说 /onlinehelp/default.aspx将转到/onlinehelp/default.php /onlinehelp/stuff/junk.aspx将转到/onlinehelp/stuff/junk.php 这似乎很简单,但我无法让它工作。我认为这会奏效: RedirectMatch 301 (/onlinehelp/.*)\.aspx$ http://www.mydomanin.c

我需要将对web特定子文件夹中的aspx文件的所有调用重定向到具有.php扩展名的相同名称和路径

比如说
/onlinehelp/default.aspx
将转到
/onlinehelp/default.php

/onlinehelp/stuff/junk.aspx
将转到
/onlinehelp/stuff/junk.php

这似乎很简单,但我无法让它工作。我认为这会奏效:

RedirectMatch 301 (/onlinehelp/.*)\.aspx$ http://www.mydomanin.com$1.php

我错过了什么?

谢谢你……它正在工作……现在。一定是缓存问题。诅咒负载平衡器!!!哈哈,很抱歉给你添麻烦。我感谢你的回答


.htaccess文件位于子文件夹/onlinhelp/中,我需要在其中进行重定向。

谢谢……它正在工作……现在。一定是缓存问题。诅咒负载平衡器!!!哈哈,很抱歉给你添麻烦。我感谢你的回答


.htaccess文件位于子文件夹/onlinhelp/中,我需要在其中进行重定向。

该重定向当前是否没有任何作用,或者URL是否与预期不同?您的代码适合我。它有错误吗?这个.htaccess在哪里?你在这个.htaccess中还有其他规则吗?这个重定向当前没有做任何事情,或者URL的结果与预期的不同吗?你的代码对我来说很有用。它有错误吗?这个.htaccess在哪里?在这个.htaccess中有其他规则吗?