如何从PHP中的以下URL生成友好的URL?

时间:2017-03-21 06:17:59

标签: php .htaccess url

这是我的旧式url

  

http://djit.ac/djitblog/?controller=blog&action=view&id=4

如何让它看起来像这样?

  

http://djit.ac/djitblog/blog/view/4

到目前为止,我已经尝试了这个,但它无法正常工作

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^blog/view/([0-9]+)/?$    ?controller=blog&action=view&id=$1    [NC,L]    # Handle product requests

0 个答案:

没有答案
相关问题