【问题标题】:htaccess rewrite a specific url to another specific urlhtaccess 将特定 url 重写为另一个特定 url
【发布时间】:2017-05-31 14:19:01
【问题描述】:

我正在尝试创建一个 htaccess 重写以实现以下目标

我有一个类似http://www.example.com/directory/test.php 的网址,想在http://www.example.com/directory/test.html 时显示此页面的内容

我尝试关注但没有成功。谁能告诉我我在这里做错了什么

 RewriteEngine On
 RewriteBase /directory/ 
 RewriteCond ^directory/test.html/?$ [NC]
 RewriteRule ^(.*)http://www.examle.com/directory/test.php [NC,L]

任何帮助将不胜感激

【问题讨论】:

    标签: apache .htaccess mod-rewrite


    【解决方案1】:

    你可以使用:

    RewriteEngine On
    RewriteRule ^directory/test\.html/?$ directory/test.php [NC,L]
    

    【讨论】:

      猜你喜欢
      • 2015-10-28
      • 1970-01-01
      • 1970-01-01
      • 2018-05-29
      • 1970-01-01
      • 1970-01-01
      • 2020-09-14
      • 2023-03-20
      • 1970-01-01
      相关资源
      最近更新 更多