Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
重定向a";子文件夹";到一个新的URL;Joomla和.htaccess_.htaccess - Fatal编程技术网

重定向a";子文件夹";到一个新的URL;Joomla和.htaccess

重定向a";子文件夹";到一个新的URL;Joomla和.htaccess,.htaccess,.htaccess,这应该很简单,我不知道为什么我在上面找不到任何东西 简而言之 (这是Joomla站点中的一篇文章,域的其余部分需要保持活动状态,因此我只需要重定向efg部分。) 需要重定向到 这在Joomla站点中是否可能(Joomla重定向组件失败) 我看到了很多在某个域内重定向的方法,甚至可以将整个域重定向到一个新域,但没有看到将一个域的一部分重定向到一个新的URL 我确信我可以弹出一个PHP页面到/abcd.org/efg/目录并以这种方式重定向它,但我想知道是否可以使用.htaccess文件 谢谢 您

这应该很简单,我不知道为什么我在上面找不到任何东西

简而言之

(这是Joomla站点中的一篇文章,域的其余部分需要保持活动状态,因此我只需要重定向efg部分。)

需要重定向到

这在Joomla站点中是否可能(Joomla重定向组件失败)

我看到了很多在某个域内重定向的方法,甚至可以将整个域重定向到一个新域,但没有看到将一个域的一部分重定向到一个新的URL

我确信我可以弹出一个PHP页面到/abcd.org/efg/目录并以这种方式重定向它,但我想知道是否可以使用.htaccess文件


谢谢

您可以尝试将此规则作为您的最高规则:

RewriteEngine On

RewriteCond %{THE_REQUEST} \s/+efg[?\s/] [NC]
RewriteRule ^ https://www.xyx.com/lmn-op-qrs/ [L,R=301]

将此规则置于.htaccess的顶部(根目录上)

RewriteEngine On
RewriteRule ^efg/$ https://www.xyx.com/lmn-op-qrs/ [R=301,L]