0

我正在使用 Joomla Sef URL,它工作正常,除了我需要“.htm”后缀而不是“.html”,请帮忙。

目前我的网址如下所示:

www.mysite.com/my-page.html

我希望它像

www.mysite.com/my-page.htm
4

2 回答 2

1

您将需要使用第 3 方搜索引擎友好链接扩展之一:http ://extensions.joomla.org/extensions/site-management/sef

于 2009-09-11T16:56:32.960 回答
0

这是一个补丁。在我的 Joomla 1.5.9(标准捆绑 SEF)上测试:

Index: includes/router.php
===================================================================
--- includes/router.php (revision 13023)
+++ includes/router.php (working copy)
@@ -57,8 +57,13 @@
            {
                if($suffix = pathinfo($path, PATHINFO_EXTENSION))
                {
-                   $path = str_replace('.'.$suffix, '', $path);
-                   $vars['format'] = $suffix;
+                   if ($suffix == 'htm') {
+                       $path = str_replace('.'.$suffix, '', $path);
+                       $vars['format'] = 'html';
+                   } else {
+                       $path = str_replace('.'.$suffix, '', $path);
+                       $vars['format'] = $suffix;
+                   }
                }
            }
        }
@@ -93,7 +98,8 @@
            {
                if($format = $uri->getVar('format', 'html'))
                {
-                   $route .= '.'.$format;
+                   //$route .= '.'.$format;
+                   $route .= '.htm';
                    $uri->delVar('format');
                }
            }
于 2009-10-28T21:04:34.907 回答