How To Restrict Access to Your Joomla Website

How To Restrict Access to Your Joomla Website

Updated on Oct 12, 2022

When you have a website, you often have to work on it, and sometimes the work is more extensive than usual. In such cases, you may need to restrict user access to your website.

In this post, we will explain how you can do that quickly on your Joomla! Website. According to the most recent statistics, Joomla is a well-liked open-source platform for websites. Of all the websites whose content management system is known, Joomla is used by 2.5% of them. This accounts for 1.6% of all websites.

Table of Contents:

How to Restrict Global Access to your Joomla Website

You can easily achieve that with one of the core features of Joomla. This feature will place your website offline for all users. You will be able to display a message to notify them that there is currently maintenance running on your site or a similar message of your choice.

  • Go to your Administrator panel;
  • Go to System → Global Configuration:

Go to System Global Configuration

  • Select the Site Tab and set the Site Offline value to Yes:

Go to Global Configuration Site

For some extensive information on how to enable maintenance mode on your Joomla! website and configuring a custom offline message, you can review our Joomla! offline mode tutorial.

How to Restrict Access to an Article

There are two different ways to restrict access to an article in Joomla:

  • Individually;
  • Globally.

Let’s go over both methods with the steps you need to follow.

How to Restrict Access to Full Article View Individually

  • Log into your Joomla admin panel:
  • Navigate to Content → Articles:

Go to Content Articles

  • Select the article to edit.
  • Set the Access Level to Registered. Do that by using the Access dropdown:

Manage Access Level for Joomla Posts

    • Select to edit desired menu item under the Options tab:

    Go to Joomla Options

    • Scroll down and set Show Unauthorized Links to Yes:

    Set Unauthorized Links to Yes

    • Save settings:

    Save Configuration in Joomla

    How to Restrict Access to an Article Globally

    • Log into your Joomla admin panel.
    • Set the article(s) or Category(ies) to view level Registered:

    Set Article Level to Registered

    • Navigate to Options → Articles:
    • Set Show Unauthorized Links to Yes:

    Set Unauthorized Links to Yes

    • Set Show Intro Text to Hide:

    Hide Intro Text Joomla

    • Show Unauthorized Links – Yes allows users to see the intro text of Articles when their user group is not allowed to access to.
    • Show Intro Text – Hide hides the intro text when the page is displayed.
    • Show Unauthorized Links – No displays of the intro text and main text.

    Note:
    If the menu setting is configured to use the article setting, the appropriate menu setting or the article setting can override these options.

    Without a "read more," content in articles is referred to be "intro text." Add a "read more" to the article if it doesn't already have one in case you have articles that are exclusively accessible to registered users. Otherwise, the entire article will be viewable to all users.

    How to Block Direct Web Access to Important Joomla Files

    When you block this type of access to some of your critical Joomla Files over the web, you are essentially reducing the chances for your site to get hacked.

    You can do that by adding some code lines into your .htaccess file, which you can access via cPanel File Manager or an FTP Client like FileZilla. For this guide, we will use File Manager. Here is the whole procedure:

    • In cPanel, find File Manager and open it:

    Find File Manager in cPanel

    • Once there, make sure that you can see hidden files:

    Show Hidden Files File Manager

    • Then you need to find your Joomla website directory and locate the .htaccess file;
    • Select the file and click on Edit, or right-click over .htaccess and choose Edit;
    • Once you are inside the .htaccess file, add the following lines of code at the end or the beginning of the file:
    <FilesMatch "configuration.php">
    Order allow,deny
    Deny from all
    </FilesMatch>
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    Now both your Joomla configuration.php and .htaccess are safer—not available for web access.

    Conclusion

    Restricting access is a simple approach to managing who can view your website or web page. If you're creating a website for internal use only and don't want to create a members section, or if your website is still being developed, you might want to do this.

    The access control levels (ACL) in Joomla are a crucial feature for sites with many users since they let you restrict access to articles, menu items, and more. This is useful if you want to limit public access to particular portions of your website.

    In case you need help with something hosting-related, always feel free to contact our 24/7 technical support team. You can do that by opening a new support ticket.

    We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!

    Al-Manar Technology Services