重定向/ directsystems /教育/索引/名/ system_one
TO
http://www.mysite.com/directsystems/education/index/name/system-one
能否请你给我301重定向规则为htaccess?因为我想用hypens重定向undescores
重定向/ directsystems /教育/索引/名/ system_one
TO
http://www.mysite.com/directsystems/education/index/name/system-one
能否请你给我301重定向规则为htaccess?因为我想用hypens重定向undescores
试试这个:
RewriteRule ^([^_]*)_([^_]*)$ $1-$2
更换所有的URI连字符-
强调_
,使用下面的.htaccess文件规定:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteRule ^([^\_]+)_([^\_]+)(_.*)$ /$1-$2$3 [N,DPI]
RewriteRule ^([^\_]+)_(.*)$ /$1-$2 [L,R=301,DPI]
这重定向的网址为:
http://localhost/directsystems/education/index/my_name/system_one
到
http://localhost//directsystems/education/index/my-name/system-one
看起来像某种错误/蛙表情的。大声笑 – Wiseguy 2011-04-29 12:03:41