Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

//FROM HERE DEVELOPER DOCUMENTATION

 

Advanced mode rewrite plugin aka. AMR provides rewriting of default CONTENIDO url's to SEO friendly url's.

AMR rewrites all url's which are created with cUri class.

AMR is high configurable plugin, you can set how your url should looks like through dirrefent settings(see screenshot below).

 

In Settings area you can make following settings:

Plugin settings

Enable AMR: through this setting you can enable and disable plugin without deactivation in plugin manager.

Path to .htaccess from DocumentRoot: with this setting you have to define path to the CONTENIDO client from your document root.

Example: http://www.my-contenido-doc-rooot.domain point to the main CONTENIDO folder, you path will be /cms/ -> where "cms" is you CONTENIDO client.

Are several clients maintained in one directory?: If you have more then one client in your CONTENIDO installation, you can prepend client to your url and use client name instead of id.

Example: http://www.my-contenido-doc-rooot.domain/cms/some-funky-article.html instead of http://www.my-contenido-doc-rooot.domain/1/some-funky-article.html

Should the language appear in the URL (required for multi language websites)?: with this setting you can prepend language to your url and use language name instead of id.

Example: http://www.my-contenido-doc-rooot.domain/cms/de/some-funky-article.html instead of http://www.my-contenido-doc-rooot.domain/cms/1/some-funky-article.html

Should the name of root category be displayed in the URL?: with this setting you can add the start category to the url's.

Example: If enabled, the name of the root category (e. g. "Mainnavigation" in a CONTENIDO default installation), will be preceded to the URL.

Configure your own separators with following 4 settings
to control generated URLs to your own taste

Category separator: with this setting you can enter category separator you wish. The possible separators you can see right of the inputs.

Example: If your separator is slash your url will looks like this example. http://www.my-contenido-page.domain/mymaincategory/mysubcategory/article.html

Category-word separator (delemiter between category words): with this setting you can set category words separator. Taht means if your category has more the one word, the separator will replace blanks.

 Example: If your category word separator is underscore your url will looks like this example. http://www.my-contenido-page.domain/my_category_with_blanks/article.html

Category-article separator (delemiter between category-block and article): with this setting you can select your separator between category and article name.

 Example: If your category word separator is underscore your url will looks like this example. http://www.my-contenido-page.domain/mycategory_myarticle.html

Article-word separator (delemiter between article words): with this setting you can set separator between article words. Article words blanks will be replaced with this separator.

 Example: If your category word separator is minus your url will looks like this example. http://www.my-contenido-page.domain/mycategory/my-article-with-blanks

Append article name to URLs: this settngs appends article name to url. This setting rewrites article names to defined name.

File extension at the end of the URL: this setting defines file extension at the end of the url

Should the URLs be written in lower case?: this setting generates url in lowercase.

Example: http://www.my-contenido-page.domain/MyCategory/MyArticle.html will look like http://www.my-contenido-page.domain/mycategory/myarticle.html

Duplicated content: this setting prevent duplicated content. Depending on configuration, pages could be found thru different URLs. Enabling of this option prevents this.

Examples for duplicated content:

  • Name of the root category in the URL: Feasible is /maincategory/subcategory/ and /subcategory/
  • Language in the URL: Feasible is /german/category/ and /1/category/
  • Client in the URL: Feasible is /client/category/ und /1/category

Percentage for similar category paths in URLs: This setting refers only to the category path of a URL. If AMR is configured to prepend e. g. the root category, language and/or client to the URL, the specified percentage will not applied to those parts of the URL.

A incoming URL will be cleaned from those values and the remaining path (urlpath of the category) will be checked against similarities.

Example: 100 = exact match with no tolerance; 85 = paths with little errors will match to similar ones; 0 = matching will work even for total wrong paths

Redirect in case of invalid articles: This setting provides redirecting to the other article, if requested article was not found.

Moment of URL generation: this setting provides point of url generation.

a) Clean-URLs will be generated during page output. Modules/Plugins are able to generate URLs to frontend
as usual as in previous CONTENIDO versions using a format like "front_content.php?idcat=1&idart=2".
The URLs will be replaced by the plugin to Clean-URLs before sending the HTML output.

Differences to variant b.):

  • Still compatible to old modules/plugins, since no changes in codes are required
  • All occurring URLs in HTML code, even those set by wysiwyg, will be switched to Clean-URLs
  • All URLs will usually be collected and converted to Clean-URLs at once.
    Doing it this way reduces the amount of executed database significantly.

b) By using this option, all Clean-URLs will be generated directly in module or plugins.
This means, all areas in modules/plugins, who generate internal URLs to categories/articles, have to be adapted manually.
All Clean-URLs have to be generated by using following function:

# structure of a normal url
$url = 'front_content.php?idart=123&lang=2&client=1';

# creation of a url by using the CONTENIDOs Url-Builder (since 4.8.9),
# wich expects the parameter as a assoziative array
$params = array('idart'=>123, 'lang'=>2, 'client'=>1);
$newUrl = cUri::getInstance()->build($params);

Differences to variant a.):

  • The default way to generate URLs to fronend pages
  • Each URL in modules/plugins has to be generated by UriBuilder
  • Each generated Clean-Url requires a database query

Routing: with this setting you can set specific routing rules.

Example: type one routing definition per line as follows:

# {incoming_url}>>>{new_url}
/incoming_url/name.html>>>new_url/new_name.html

# route a specific incoming url to a new page
/campaign/20_percent_on_everything_except_animal_food.html>>>front_content.php?idcat=23

# route request to wwwroot to a specific page
/>>>front_content.php?idart=16
  • The routing does not sends a HTTP header redirection to the destination URL, the redirection will happen internally by
    replacing the detected incoming URL against the new destination URL (overwriting of article- categoryid)
  • Incoming URLs can point to non existing resources (category/article), but the desttination URLs should point
    to valid CONTENIDO articles/categories
  • Destination URLs should point to real URLs to categories/articles,
    e. g.front_content.php?idcat=23 or front_content.php?idart=34
  • The language id should attached to the URL in multi language sites
    e. g. front_content.php?idcat=23&lang=1
  • The client id should attached to the URL in multi client sites sharing the same folder
    e. g. front_content.php?idcat=23&client=2
  • The destination URL should not start with '/' or './' (wrong: /front_content.php, correct: front_content.php)

In functions area you can make following settings:

Functions

Copy/Download .htaccess template: in this setting you can select the .htacces type. On this point you have two different templates, you can copy or download the template.

Restrictive .htaccess: contains all restrictive settings. All requests with file type js, ico, gif, jpg, jpeg, png, css, pdf will be not rewritten. All other file type will be rewritten to front_content.php.

Folders contenido/', 'setup/', 'cms/upload', 'cms/front_content.php' are excluded from the rewriting. If you want to exclude some another files or folders you have to define it explicit.

Simple .htaccess: contains simply rewriting rules. All request to the valid symlinks, folders or files are excluded from the rewriting. All another requests will be rewritten to the front_content.php.

 

Reset category-/ and article aliases: with this setting you can reset all or only empty alliases.

In test area you can test your amr related settings:

Test


The test area provides testing of the current AMR configuration.

Define options to genereate the URLs by using the form below and run the test: with this setting you can define test params for the current configuration. That can be idcat which is category id, idart which is article id, idcatart which is relation id between category and article

or idartlang which is article id in certain language. After that you can input count of article ids and run test.

After test, you can see how much url were rewritten, successfull resolved,  errors etc.


//END


AMR is high configurable plugin, you can set how your url should looks like through dirrefent settings(see screenshot above).

Example: show language in url or url ending with index.html etc.

Always activate this plugin after CONTENIDO installation. Url's looks nicer and human readable.

Url without AMR: www.some-url/cms/front_content?idart=1&lang=3

Url with AMR: www.some-url/cms/myniceurlcat/myniceurlart/index.html

In area functions you canselect the type of .htaccess file and copy it in different directories or reset aliases

In the area test you can test configuration you made. After test you will see statistics about resolving.


  • No labels