2012-02-17 51 views

回答

2

将这个。

Options +FollowSymLinks -MultiViews -Indexes 
RewriteEngine on 
RewriteBasae/

RewriteCond %{ENV:REDIRECT_STATUS} 200 
RewriteRule^- [L] 

RewriteRule ^subdir/(\w+)/(\w+)/(\w+)/([\w\d-]+\.[\w]+)/?$ /$1/$2/$3/$4 [NC,R=301,L] 
RewriteRule ^(\w+)/(\w+)/(\w+)/([\w\d-.]+\.[\w]+)/?$ subdir/$1/$2/$3/$4 [L] 
+0

有没有更好的方法来做到这一点,任何深度的子文件夹?例如,通配符正则表达式? – JamesWilson 2016-12-08 12:05:55