我的.htaccess文件如下,
DirectoryIndex routing.php
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} \s/+Milan_Practice/Milan_Mvc/routing\.php[\s?] [NC]
RewriteRule ^ Milan_Practice/Milan_Mvc/ [L,R=302]
RewriteRule ^Milan_Mvc/?$ Milan_Mvc/routing.php [L,NC]
通过Appling上面的代码,我得到了如下所示的网址
http://localhost/Milan_Practice/Milan_Mvc/?name=about
上面的,在“?”之后,数据的格式不是我想要的格式,
http://localhost/Milan_Practice/Milan_Mvc/about/
因此,请为上述代码提供适当的重写规则
谢谢你提前!!!
答案 0 :(得分:0)
RewriteRule ^([a-z]{2,2})/([a-zA-Z0-9_-]+)$ index.php?name=$1 [QSA]