【问题标题】:Htaccess rewrite .php to .htmlHtaccess 将 .php 重写为 .html
【发布时间】:2017-05-31 09:09:45
【问题描述】:

htaccess 重写:

所以我想从这个网址:

strapgua.com/index/product.php?title=小牛皮到 strapgua.com/index/Calfskin.html

这是可能的还是我错过了什么?

我尝试的脚本当然不起作用:

选项 +FollowSymLinks 重写引擎开启 重写规则 ^([^/]*)\.html$ /index/product.php?title=$1 [L]

【问题讨论】:

    标签: .htaccess mod-rewrite url-rewriting


    【解决方案1】:

    你几乎拥有它!

    您需要在.htaccess 中使用的是:

    RewriteEngine On
    RewriteRule ^index/([^/]*)\.html$ /index/product.php?title=$1 [L]
    

    只需确保在测试之前清除缓存即可。

    【讨论】:

    • 没问题,很高兴能帮上忙 :)
    猜你喜欢
    • 2012-12-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-11
    • 2015-10-22
    • 2014-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多