【问题标题】:Create custom page urls [closed]创建自定义页面网址 [关闭]
【发布时间】:2014-03-16 18:20:58
【问题描述】:

我的链接现在是 exp。 http://example.com/index.php,如何将其更改为 exp。 http://example.com/idex-home-page.html

【问题讨论】:

标签: php .htaccess mod-rewrite


【解决方案1】:

在 .htaccess 中试试这个

RewriteEngine on

RewriteRule idex-home-page.html index.php

你也应该看看这个初学者教程:

http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

【讨论】:

    【解决方案2】:

    如果我猜对了。

    您要么尝试更改主页目录。 你不想为此加入 htaccess 的东西。

    您可以简单地更改您的网络服务器设置。检查您的 Web 服务器的文档。对于 Apache,这可能很方便http://httpd.apache.org/docs/current/en/sections.html

    有很多解决方案。对于您的情况,这可能是一种解决方案,但是。在你的 index.php 中

    <meta http-equiv="refresh" content="1;url=http://example.com">
    

      <script type="text/javascript">
         window.location.href = "http://example.com"
      </script>
    

    取自:Redirect from an HTML page

    【讨论】:

      猜你喜欢
      • 2014-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多