我想要我的网址是: http://localhost/slide-form/ad_posted.php?title=Cow%20Buffalo%20Gopal-1426356570
看起来像 : http://localhost/slide-form/ad_posted/title/Cow%20Buffalo%20Gopal-1426356570/
以下是我在htaccess文件中添加的规则:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ad_posted/title/(.*)/ ad_posted.php?title=$1
RewriteRule ad_posted/title/(.*) ad_posted.php?title=$1
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.html
</IfModule>
但是我的网址没有任何变化。任何帮助深表感谢。谢谢
在以下代码中/slide-form/.htaccess
:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /slide-form/
RewriteCond %{THE_REQUEST} /ad_posted\.php\?title=([^\s&]+) [NC]
RewriteRule ^ ad_posted/%1? [R=302,L,NE]
RewriteRule ^ad_posted/title/(.+)/?$ ad_posted.php?title=$1 [L,QSA]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句