我有一个类似的网址:
http://skepticalgamer.com/category/slam-the-controller
我想从 URL 中去掉“类别”。所以我想要:
http://skepticalgamer.com/slam-the-controller
就像上面的原始 URL 一样。用 mod_rewrite 可以做到吗?
最佳答案
是的,您可以使用 mod_rewrite 执行以下操作:
RewriteRule ^slam-the-controller$ category/slam-the-controller
这将采用 URL:
http://skepticalgamer.com/slam-the-controller
并将其重写为:
http://skepticalgamer.com/category/slam-the-controller
https://stackoverflow.com/questions/3055794/