TVs. Consoles. Projectors and accessories. Technologies. Digital TV

Patient option com k2. Regex - examples - validate htaccess rules. How to properly update K2 to the latest version

I woke up in my room. And this reality seemed to me a much smaller reality than the one where I had just been. I remembered everything down to the smallest detail. And this feeling overwhelmed me so much that I jumped up and ran to my parents’ bedroom to tell them. I rushed along the corridor and, opening the door to my parents’ bedroom with a roar, screamed, “I’ve just been among the blue stars!”

At that same second, my mother woke up in alarm, the night light came on and Newf Dani, who always slept on the rug next to his parents’ bed, muttered muffledly. My father woke up, and I jumped onto my parents’ bed with a running start and, choking and gesticulating, began to tell the story. Mom touched my forehead, deciding that I had a fever, then began stroking my head and calming me down, saying that I was just having a bad dream. I was very offended. "This is not a dream!" - I shouted - “It’s a miracle, how beautiful!” Mom's eyes filled with tears and she looked helplessly at her father. And I kept trying to say something. And suddenly I heard my father’s voice - “Say – Fish!” I was so taken aback that I fell silent. And he obediently said, “Fish.” “Yes,” said the father. - “Now say – frame.” “Rama,” I repeated. “Watermelon, novel, river,” the father demanded. I repeated, not understanding what he wanted from me. And suddenly, with some inner hearing, I heard that I was pronouncing a letter that had never been given to me. The letter "R". It flew out of me, rolling and clean. I was very surprised.

Here I will make a small digression to explain why this was surprising.
I had swallowed the letter “R” before. She didn't exist at all. I said “y-yba, a-abuz” and so on. A speech therapist worked with me unsuccessfully, but the “r” never appeared. Moreover, all my mother’s friends really liked the way I spoke, and when, finally, my grandmother said that the boy had a very aristocratic pronunciation, they left me alone. And suddenly this “R” appeared, and what a one!

I listened to myself in surprise and then felt that my knee was hurting. I pulled up my pajama pants and saw a round red spot on my knee. I remembered that I hit a glowing ball on my journey. Here it is - proof! Now they will believe me! I again tried to explain something, pointing at my knee, but this alarmed my mother even more. She began to cry, said that I got hurt somewhere and forgot about it, and began to look for green stuff. I obeyed, watched as my knee turned green, it stung terribly, but I didn’t cry. I must say that just yesterday I would have roared. And here my nose didn’t even tingle. After this execution, my father took me in his arms and carried me to the nursery, my mother walked nearby, wailing and blowing on my knee, and our Newf Denis completed the procession. They put me into bed, tucked a blanket on all sides and I pretended to fall asleep. Mom and Dad kissed me and walked quietly to the door.

“Dani is behind me,” said the father. But Dani didn't move. "Dance!" – Dad repeated imperiously. Dani didn't move. But he always obeyed my father unquestioningly. Then his father came to take him away. And Dani, our good-natured Dani, bared his fangs and said – “RRR-A!!!” I laughed - “Leave him, dad - he won’t go anywhere anyway.” My father’s eyes widened, but he, taking my mother’s hand, left my nursery and quietly closed the door. And I, grabbing Dance by the powerful neck, told him everything in a whisper. Dani looked me straight in the eyes and understood everything. And he believed every word I said! After that, I plopped down contentedly on the pillow and fell fast asleep.

© Copyright: Wolf Angel, 2010

Component K2 is a very interesting extension for Joomla. The main feature of the component is that it allows Joomla to use new functions that are not available by default for Joomla, but are available in other similar CMSs such as Drupal and Wordpress.

First of all, this is the ability to add materials and articles to the site by site users, as well as creating news portals, blogs, catalogs, introducing additional fields for each article, adding videos to the site using the AllVideos plugin, image galleries using the Simple Image Gallery plugin, built-in a system for adding comments with captcha from Google, a registration and authorization module, an author module that allows you to display information about the authors publishing articles, the presence of an archive, a category and tags module.

All these modules are built into K2 and are not included in Joomla by default. Working with this component is very simple, since the text editor has the same parameters as Joomla, and using categories makes it possible to set settings for all articles in a given category at once using the “Inherit from category” function. In addition, in each material it becomes possible to display social bookmarks, hit views, vote ratings, and navigation.

To date component K2 Already updated to version 2.10.1. This release fixes all known bugs discovered by the K2 community since previous versions were released. In addition, this version also includes major changes regarding the settings for displaying your content and editing it from the front part of the site. A new version 2.11.0 is expected in the near future.

How to properly update K2 to the latest version

Updating K2 to the latest version (2.10.1)

Many people are interested in the question of how to properly update the K2 component of previous versions to the latest version, version 2.10.1.

If you are using K2 v2.7.x or v2.9.x then it is (as always) safe to upgrade to K2 v2.10.1, just install the new version over the previous one.

If you have an old version of K2 (2.4) and are using your own K2 template.

Updating the k2 component to the latest version, namely version 2.6.5, is quite simple. The new version of k2 is installed on top of previous versions. (No need to delete anything, just install the new version and everything will work). But before you upgrade, you should understand that if you are using your k2 template from previous versions, for example, k2 2.5.7 and earlier, such a template is not compatible with the new k2.

The template version 2.6.2 is compatible with version 2.7.1 although it differs slightly from the previous version in one file (generic.php) the path to the file components/com_k2

Download the K2 zip file and go to the extension manager (Install/Uninstall) in Joomla admin and select to download and install the zip file you just downloaded ( com_K2_v2.7.1.rus). After this, the component will be updated to the latest version, or simply use automatic update from the Joomla admin panel.

As always, don't forget to back up your site before updating K2 to the latest version, use the free one backup component Akeeba .

Yes, you are using your own or a modified template, then starting from version 2.7.0 there have been changes in the K2 template, so be careful when (after) updating you will have to adjust the template.

Installing a crack for K2 through the Joomla admin panel

If you have the English version of K2 installed, then you can Russify it; to Russify the component, install the Russifier that k2_ru_language_pack.zip, the crack is installed through the extension manager (Install/Uninstall) in the Joomla admin panel, like any other extensions for Joomla. After installing the Russifier, the K2 component on the site and in the admin panel will be completely Russified.

Article run is one of the effective ways of promotion at the moment. Now the effect of running Joomla K2 engines is lower than it was before. Nowadays, even articles with links don’t immediately appear in the index, but it’s still better than running through profiles, etc. In this article I will tell you how to post articles on such engines, and also provide you with a template for automating this process.

How to post articles on Joomla K2?


Often, site owners are not even aware of such a hole (the ability to leave indexed links from someone else’s resource to your own for free). And registration/login is often absent in visible areas of the site.

In order for us to register, we connect to the site on the JoomlaK2 engine /index.php?option=com_user&view=register.


When registering, the following fields are included: login, password, email and a custom description. This is where we will leave our article in a free description (there are no restrictions on the number of characters in the description). I’ll tell you what the description should look like a little later, when we analyze the template.

After we clicked the "Register" button, you must confirm your registration. As a rule, a confirmation link is sent by email, so use real addresses. Essentially, the article has already been posted, but we need a link to the result, so let's move on.

After confirmation of registration, log into the site under your name, substituting /index.php?option=com_user&view=login to the site address
Next, go to the profile page, substituting /index.php?option=com_user&view=user&task=edit for the site

Open the source code of the page and look for a similar piece of code at the bottom:

Code:

Here we need our account ID, here it is name="id" value="366".
Next, follow the link, substituting the site: /?option=com_k2&view=itemlist&task=user&id="Our ID". And now you can see our result.


Features when creating a template


I think that any user can make a simple registration template (if not, or maybe someone is too lazy, then the template is below).
Since Joomla is an engine and it has the ability to install different WYSIWYG editors, we need to turn off JavaScripts so that it does not load, and we use the standard editor.
Briefly about the text, anchors should be in this format: http://site.ru/ ">anchor, http:// required! HTML tags are also supported, such as , .
Now about the template.

Input parameters:
E-mail - I think this is clear.
Password is the same.
Use headings - framed text is used as headings

.

Files:
domains.txt is our domain database.
results.txt - the result of the run, in the format: url login pass (TAB whitener).
titles.txt - your titles, each on a new line (don’t forget that the file must be in URF-8, otherwise you will have gibberish instead of Russian characters).
errors.txt - a file with errors; the main ones are processed in the template.
Texts folder - your articles are located here (1 file = 1 article).
In the Texts folder there is a Done folder - published articles are moved here.

To launch the template, open the ZennoPoster program. Click the "Add" button and select the project file you want to run.

In this review, we’ll look at how to find and permanently remove duplicate pages.

How do duplicate pages occur?

The main reasons for the appearance of duplicates are the imperfection of the site’s CMS; almost all modern commercial and non-commercial CMSs generate duplicate pages. Another reason may be the low professional level of the website developer, who allowed duplicates to appear.

What are duplicate pages?

1. The main page of the site, which opens with www and without www

example www.site.ua and site.ua

site.ua/home.html and site.ua/

2. Dynamic site content with identifiers?, index.php, &view

site.ua/index.php?option=com_k2&Itemid=141&id=10&lang=ru&task=category&view=itemlist

site.ua/index.php?option=com_k2&Itemid=141&id=10&lang=ru&layout=category&task=category&view=itemlist

3. With and without a slash at the end of the URL

4. Filters in the online store(example)

site.ua//?Itemid=&product_book&

5. Print pages

site.ua/cadok/?tmpl=component&print=1&layout=default&page=”

What dangers do duplicate pages pose?

Imagine that you are reading a book where the pages have the same text, or very similar one. How useful is this information to you? Search engines find themselves in the same position, searching among duplicates of your site for useful content that the user needs.

Search engines do not like such sites, therefore your site will not rank high in searches, and this poses a direct threat to it.

How to detect duplicates on a website

1. Using a command site:site.ua You can check which duplicates are included in the search engine index.

2. Enter excerpts of phrases from your site into the search, this way you will find pages on which it is present

3. Google Webmaster Tools, under Search View → HTML Optimization, you can see pages that have duplicate meta descriptions or titles.

5 Ways to Remove Duplicate Pages

1. Using the robots.txt file

Disallow: /*?
Disallow: /index.php?*

Thus, we will let the search engine know that pages that contain parameters?, index.php?, should not be indexed.

There is one “but”: the robots file is only a recommendation for search engines, and not a rule that they absolutely follow. If, for example, a link is placed on such a page, it will be included in the index.

2. The .htaccess file allows you to solve the problem with duplicates at the server level.

Htaccess is an Apache server configuration file located at the root of the site. Allows you to configure the server configuration for a single site.

Glue website pages together with a 301 redirect.

Redirect 301 /home.html http://site.ua/ (for static website pages)

RewriteCond %(QUERY_STRING) ^id=45454
RewriteRule ^index.php$ http://site.ua/news.html? (redirect for dynamic pages)

Use 410 redirect(complete removal of the take)
He reports that there is no such page on the server.

Redirect 410 /tag/video.html

Set up a domain with www and without www

Example with www
Options +FollowSymLinks
RewriteEngine On
RewriteCond %(HTTP_HOST) ^site\.ua
RewriteRule ^(.*)$ http://www.site.ua/$1

Without www
Options +FollowSymLinks
RewriteEngine On
RewriteCond %(HTTP_HOST) ^www.site.ua$
RewriteRule ^(.*)$ http://site.ua/$1

Add a slash at the end of the URL

RewriteCond %(REQUEST_URI) (.*/[^/.]+)($|\?) RewriteRule .* %1/

For sites with a large number of pages, it will be quite labor-intensive to search and merge duplicates.

3. Webmaster Tools

The URL Parameters feature allows you to prevent Google from crawling website pages with certain parameters.

Or manually delete

Deleting pages is only possible if the page:

Prohibited for indexing in the robots.txt file

Returns a 404 server response

Prohibited by noindex tag

4.Meta tag noindex- This is the most effective way to remove duplicates. Removes forever and irrevocably.

According to Google, the presence of the noindex tag completely excludes the page from the index.

Important. In order for the robot to delete a page, it must index it, that is, it must not be blocked from indexing in the robots.txt file.

This can be implemented through PHP regular expressions using the function preg_match().

5. The rel="canonical" attribute

The rel="canonical" attribute makes it possible to specify the recommended (canonical) page for indexing by search engines, so duplicates do not end up in the index.

rel="canonical" can be specified in two ways

1. Using the link attribute in the HTTP header

Link: ; rel=”canonical”

2. To section add rel="canonical" for non-canonical versions of pages

In some popular CMSs, the rel="canonical" attribute is implemented automatically - for example, Joomla! 3.0 (read about ). Other CMSs have special add-ons.

Let's summarize. When developing a website, take into account the possibility of duplicates and determine in advance how to deal with them. Create the correct website structure (more details.

Periodically check the number of pages in the index, and use the capabilities of the Webmaster Toolbar.

Materials used in writing

Save

Save



Replace "index.php? Option=com_k2 & view=item & id=" using .htaccess and Regex (2)

You can't capture the query string in a RewriteRule . Use RewriteCond instead. Use this rule at the top of your .htaccess:

RewriteCond %( THE_REQUEST ) / index\.php\?option = com_k2 & view = item & id =([^ \s &]+) [ NC ] RewriteRule ^ https : //www.portal-gestao.com/artigos/%1?

How to replace:

https: //www.example.com/index.php?option=com_k2&view=item&id=7377 https: //www.portal-gestao.com/artigos/7377

I tried this:

RewriteRule ^ index . php? option = com_k2 & view = item & id =(.*) $ / artigos / $1 [ R = 301 , L ] RewriteRule ^ index . php? option = com_k2 & view = item & id = \/ ([ 0 - 9 ]( 4 )-.*) $ / artigos / $1 [ NC , R , L ]

You can also do this with RewriteCond Query String matching code:

# Individual explicit redirect rules based on exact matching URI|Query String parameters#$1? Strip the option=com_k2&view=item&id=7377 Query String from the destination URI RewriteCond %( QUERY_STRING ) ^ option = com_k2 & view = item & id = 7377 $ [ NC ] RewriteRule ^(.*) $ / artigos / 7377 / $1 ? [ R = 301 , L ] RewriteCond %( QUERY_STRING ) ^ option = com_k2 & view = item & id = 7378 $ [ NC ] RewriteRule ^(.*) $ / artigos / 7378 / $1 ? [R=301,L] # Dynamically redirect all matching Query Strings to equivalent URI# %2 match and redirect to equivalent 4 digit number URI#$1? Strip the option=com_k2&view=item&id= portion of the Query String from the destination URI RewriteCond %( QUERY_STRING ) ^(option = com_k2 & view = item & id +)=([ 0 - 9 ]( 4 )+) $ [ NC ] RewriteRule ^(.*) $ / artigos /% 2 / $1 ? [R=301,L]

Related publications