0

I have been trying to add rewrite rule to .htaccess file but it does not seem to work. I have Joomla latest version and I am trying to do it by:

# Return 403 Forbidden header and show the content of the root homepage
RewriteRule index.php/en?option=com_users&view=login [F]

So I paste it here:

RewriteEngine On
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule index.php/en?option=com_users&view=login [F]

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed 
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

What is possibly wrong?

4
  • You don't seem to have a RewriteCond statement so the system probably doesn't know what rule you want to Rewrite. What are you trying to achieve?
    – Irata
    Commented Oct 22, 2019 at 22:09
  • I want to disable access to frontend login page. Once user will try to paste to his browser it will redirect to frontpage index.php/en?option=com_users&amp;view=login
    – 10101
    Commented Oct 22, 2019 at 22:11
  • 1
    As this is not specifically a Joomla issue you might find more information and examples over at webmasters.stackexchange.com/search?q=%5Bhtaccess%5D+redirect
    – Irata
    Commented Oct 22, 2019 at 22:29
  • Or you can try this search which has various ideas of how to do it, including the one you have shown here. google.com/…
    – Irata
    Commented Oct 22, 2019 at 22:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.