SEO Strict URLs
In certain cases, search engine algorithms will penalize websites for displaying identical content among multiple pages. With friendly URLs (FURLs) turned on and a FURL suffix defined, the same document can potentially be referenced using 8 separate URLs:
http://yoursite.com/doc_id
http://yoursite.com/doc_id/
http://yoursite.com/doc_id.suffix
http://yoursite.com/doc_id.suffix/
http://yoursite.com/alias
http://yoursite.com/alias/
http://yoursite.com/alias.suffix
http://yoursite.com/alias.suffix/
This plugin, which was devised by Jeremy Luebke and modified by myself, uses 301 redirects to forward users and search engines alike to a single URL based on plugin and FURL configuration. In addition to redirecting, the plugin can also (optionally) rewrite document links/URIs.
Example scenario, with FURLs turned on and '.html' as the FURL suffix:
http://yoursite.com/site_start.html -> http://yoursite.com/
http://yoursite.com/feed.rss.html -> http://yoursite.com/feed.rss (TV override, with basename set)
http://yoursite.com/container.html -> http://yoursite.com/container/ (if rewrite containers as folders is enabled or TV override)
Currently known limitations:
- Will only rewrite links with double quotes
- Will not rewrite URLs with relative paths (../.. etc)
You may boost up your revenue of internet marketing business by adopting the latest strategies of pay per click. If you are launching a new website, you have to get services of highly remarkable web hosting companies. The effective tools of search engine optimization are very helpful in optimizing the websites rapidly. The advertising agencies are earning the massive amount of money by promoting their business of advertisement of different products or services of the enterprisers.
Installation:
- Download the latest plugin code below.
- Go to Resources -> Manage Resources -> Plugins in the MODx manager and click "New Plugin".
Plugin name: SEO Strict URLs
Description: 1.0 Enforces the use of strict URLs to prevent dup content - Open the downloaded plugin in the text editor of your choice and copy and paste the code into the "Plugin code (php)" text box.
Click on the "Configuration" tab and copy and paste the following into the "Plugin configuration" text box:
Code:
&editDocLinks=Edit document links;int;1 &makeFolders=Rewrite containers as folders;int;1 &emptyFolders=Check for empty container when rewriting;int;0 &override=Enable manual overrides;int;0 &overrideTV=Override TV name;string;seoOverride
Once the configuration line is added, the new options will appear in an html form below the configuration line itself. Setting "Enable manual overrides" from 0 to 1 will enable URL overrides via template variable (TV).
- Click the "System Events" tab and check the OnWebPageInit & OnWebPagePrerender boxes.
- At this point, the plugin can be saved and should be enforcing strict URLs on the MODx site.
Override TV Setup
For overriding specific documents, create a new template variable (TV) named seoOverride (or whatever you have defined in the configuration) and enter the following:
Input Type: DropDown List Menu
Input Option Values: Disabled==-1||Base Name==0||Append Extension==1||Folder==2
Default Value: -1
Available Downloads:
| Filename | Filesize | Downloads | Date |
|---|---|---|---|
| seo_strict_urls_1.0.2.snippet.php.txt | 6.42 kB | 67 | 2010-07-28 |
| seo_strict_urls_1.0.1.snippet.php.txt | 6.65 kB | 35 | 2007-05-31 |