Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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 http重定向仅更改第一个目录名_.htaccess_Apache2 - Fatal编程技术网

.htaccess http重定向仅更改第一个目录名

.htaccess http重定向仅更改第一个目录名,.htaccess,apache2,.htaccess,Apache2,我在重定向方面有困难 我有/confs/2014/[month]/[city]/[shortname]/例如: /confs/2014/06/london/icamme/ /confs/2014/09/paris/icadd/ /confs/2014/10/losangles/icamad/ 我有12个月,80个城市,许多短名字,在它们下面有真正的html文件。我想将它们重定向到php sys。Php需要的格式是 /conf/2014/[month]/[city]

我在重定向方面有困难

我有/confs/2014/[month]/[city]/[shortname]/例如:

     /confs/2014/06/london/icamme/
     /confs/2014/09/paris/icadd/
     /confs/2014/10/losangles/icamad/
我有12个月,80个城市,许多短名字,在它们下面有真正的html文件。我想将它们重定向到php sys。Php需要的格式是

/conf/2014/[month]/[city]/[shortname]/
我在下面试过这个

RewriteRule ^conferences\/2014\/(.*) conference/2014/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?path=$1 [L,QSA]

但是它没有重定向

无法获取它,您可以尝试再次解释您的问题吗?什么不起作用?我要求您清楚地解释您的问题:)没有包含
conf
conf
的重写规则。您希望如何将第一个url重写为第二个url?您也没有任何外部重定向,只有内部重写。外部重定向需要
[R]
标志。有关更多信息,请参阅。