Drupal Pathologic Module Best Solution to Get Rid of Broken Links

By: Deepu Balan    |    In: Tutorials       

You want your business website to appear professional and leave an impact on the minds of the users. However one problem that many websites face is with broken or invalid link. They can be one of the worst killers on your Drupal site. They not only make your website appear unprofessional but can also affect search engine ranking. How do you tackle this menace when you have a large websites with hundreds of pages? The problem equally persists with small websites too and affects them equally. To overcome this problem you can make use of the Pathologic Module.

What is Pathologic?

It is basically an input filter that can correct paths in links and images in your drupal content in situations where the URL of your site chances such is in case when you are moving the site to a different server or altering the sub-indexes. In normal scenarios that would cause the links to ‘break’. This module also helps you solve the problem of missing images and broken links in your RSS feed. This module has been designed to be simple and developers have named it set-it-and-forget-it utility.
drupal pathologic module

How To Use It?

It works like any other Drupal module that you have used so far. You need to download the Pathologic module and enable it. However since this module is an input filter as we have mentioned above it won’t work by itself and you need to configure it.  Along with the module you will also get documentation that has detailed steps on configuring this filter. In short you need to configure the text format that you would normally use for your content such as ‘Full HTML’. However this configuration process needs you to foresee your needs and hence it should be done with care.

Common Issues That Crop Up With Pathologic

Though Pathologic module helps you tackle all kinds of problems with Drupal broken links it does also face certain issues. Let us now take a look at some of these problems and how you can customize Pathologic to overcome these bottlenecks -

HTTP or HTTPS

A common problem that developers face with this module is while using both the HTTP and HTTPS protocols on the same site. You are aware of the fact that HTTPS encrypts communication between the client and the server via a SSL (Secure Sockets Layer). Hence we find the suffix ‘S’ that we commonly associate with ‘Secure’. In a normal Drupal site HTTP protocol is used for normal traffic or anonymous traffic to the site while administrators make use of HTTPS protocol to log in and edit the website. So where is the problem? When an administrator adds a relative link to the website do they follow the HTTP or HTTPS protocol?

If you post content on the website using HTTPS protocol as an anonymous user might not be able to view that content. For instance an image that you post would appear perfect to you but a viewer would find the image holder empty. Your problem doesn’t end here as the user might also get a ‘Warning’ saying that the page the page has an Insecure Certificate.  In majority cases the user would abort the website immediately. How do you get rid of this problem?

Remember we mentioned that you would need to configure the Pathologic Module in the beginning of this article and we did it so because we had foreseen this issue. When you are configuring the module you are presented with three options in terms of how the URL should be generated. They are -

Full URL (http://mysite.com/country/state)
Protocol relative URL (//mysite.com/country/state)
Path relative to server root (/country/state)

The Full URL option is ideal to fix the problem of broken links in syndicated content such as in RSS feeds. However the problem with HTTP and HTTPS will persist. The second option i.e. Protocol relative URL will avoid the HTTP/HTTPS problem but will create issues with feed readers as they might be confused with the paths. Path relative URLs would solve HTTP/HTTPS without any compatibility concerns but won’t fix broken images and links in syndicated content.

So What Are Your Options?

Make use of path relative URLS as this will put your site first and even if the RSS feed breaks you don’t lose out on the bulk of traffic. Using the HTTP protocol for accessing your admin isn’t advisable as this opens up new risks. If you use the HTTPS protocol as most users do you will need to purchase a secure certificate to prevent users from aborting the site.

Pathologic does offer you the solution to broken links but it does have its share of problems as we have highlighted above. It is however one of the best bets you are having.

This guest article was written by Koushal, who is an eMarketing enthusiast who loves to help people in developing effective online marketing strategies and is working with ValueCoders, a web/software development company india, specialized in CMS development and web 2.0 application development. One can hire Drupal programmer here for effective Drupal development services.
Written by Deepu Balan

Deepu Balan is a self-taught web UI designer and developer who is really passionate about web design related stuffs. You can follow his updates on twitter @bdeepu