Actions

Portal talk

Difference between revisions of "Search Engine Optimisation"

From Joomla! Documentation

m (Change default SEF suffix from .html to anything you want.: Forgot sig.)
(Updating "Add a static text in the " to "Change global page title element": new section)
Line 46: Line 46:
 
</pre>
 
</pre>
 
[[User:Iarp|Iarp]] 18:35, 12 February 2011 (UTC)
 
[[User:Iarp|Iarp]] 18:35, 12 February 2011 (UTC)
 +
 +
== Updating "Add a static text in the <title>" to "Change global page title element" ==
 +
 +
A user should not be editing core Joomla files as whomever wrote this section has instructed.
 +
 +
The only "core" files that should be changed are those in the template folder as per [[Customize the dynamic page title]]
 +
 +
Unless someone has any other reason as to why the core files themselves should be edited, i say this section needs to change to the same information found on [[Customize the dynamic page title]] and set the other page to a redirect to this [[SEO#Add_a_static_text_in_the_.3Ctitle.3E|SEO]] page.
 +
[[User:Iarp|Iarp]] 19:39, 14 February 2011 (UTC)

Revision as of 14:39, 14 February 2011

For some reason the lines $path = str_replace('.'.$suffix, , $path); do not include the two single quotes in between the $suffix and the $path variables. --Dhuelsmann 17:07, 19 May 2010 (UTC)

Change default SEF suffix from .html to anything you want.

You could technically change the suffix to anything you wanted. Just change the myown_suffix to whatever you wanted and add it to the htaccess file.

The only issue being if you use your own suffix it most likely won't fit with proper SEO guidelines/techniques.

 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 == 'myown_suffix') {
 +                                              $path = str_replace('.'.$suffix, '', $path);
 +                                              $vars['format'] = 'html'; # Leave it alone.
 +                                      } else {
 +                                              $path = str_replace('.'.$suffix, '', $path);
 +                                              $vars['format'] = $suffix;
 +                                      }
                                }
                        }
                }
 @@ -93,7 +98,8 @@
                        {
                                if($format = $uri->getVar('format', 'html'))
                                {
 -                                      $route .= '.'.$format;
 +                                      //$route .= '.'.$format;
 +                                      $route .= '.myown_suffix';
                                        $uri->delVar('format');
                                }
                        }

.htaccess

Line 67: RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|\.myown_suffix|/[^.]*)$  [NC]

Iarp 18:35, 12 February 2011 (UTC)

Updating "Add a static text in the <title>" to "Change global page title element"

A user should not be editing core Joomla files as whomever wrote this section has instructed.

The only "core" files that should be changed are those in the template folder as per Customize the dynamic page title

Unless someone has any other reason as to why the core files themselves should be edited, i say this section needs to change to the same information found on Customize the dynamic page title and set the other page to a redirect to this SEO page. Iarp 19:39, 14 February 2011 (UTC)