【问题标题】:putting .htm at the end of url with .htaccess in OSCLASS scripts将 .htm 放在 url 的末尾,并在 OSCLASS 脚本中使用 .htaccess
【发布时间】:2013-02-20 09:15:29
【问题描述】:

我正在使用 OSCLASS 脚本,并且正在使用 .htaccess 来重写 url。 OSCLASS 生成的默认 .htaccess 给出了这样的网址 (http://myhost.com/saleon/vehicles/cars/honda-civic_i28) 我想在每个网址的末尾添加“.htm”。所以我的网址看起来像这样(http://myhost.com/saleon/vehicles/cars/honda-civic_i28.htm)。有没有人知道如何在 htaccess 中做到这一点。我的 .htaccess 代码如下:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /saleon/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /saleon/index.php [L]
</IfModule>

感谢您的帮助。

【问题讨论】:

    标签: .htaccess url-rewriting seo osclass


    【解决方案1】:

    .htaccess 中无需这样做。您可以在 oc-admin 中更改它:Settings &gt; Permalinks,然后单击 Show rules

    例如,列表的默认永久链接如下所示:{ITEM_TITLE}-i{ITEM_ID},它会生成您之前提到的 url。但是,如果您更改以下值的值,您将获得一个以 .htm 结尾的 url:{ITEM_TITLE}-i{ITEM_ID}.htm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-31
      • 2015-05-01
      • 2021-03-09
      • 1970-01-01
      • 2012-06-01
      • 1970-01-01
      • 2022-01-25
      • 2015-02-10
      相关资源
      最近更新 更多