我正在创建PHP查看页面脚本,我添加了.htaccess文件以删除空白URL标题,例如我的URL http://localhost/zblog/source/8/xcccxcx%20cxcx%20c,我想获得类似此URL http://localhost/zblog/source/8/xcccxcx-cxcx-c
这是我的代码
RewriteRule ^source/([0-9]+)/([0-9A-Z\-].*)/?$ source.php?srcid=$1&title=$2 [NC,QSA,L]
RewriteRule "^(\S*) +(\S* .*)$" $1-$2 [N,NE]
RewriteRule "^(\S*) (\S*)$" $1-$2 [L,R=302,NE]